diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-10-21 21:45:57 +0200 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-10-21 21:45:57 +0200 |
commit | a0c4b252e5867219871b5c6df10219d916e29bff (patch) | |
tree | 08cc82ec20db1c68ec6002d965209c5168fad7a9 /src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java | |
parent | 38847dbb8809a8214a911b120b6b11ee4d7f1399 (diff) |
Tabs to spaces
Diffstat (limited to 'src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java')
-rw-r--r-- | src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java b/src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java index 4940a16..6e2c79e 100644 --- a/src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java +++ b/src/pl/edu/mimuw/cloudatlas/model/TypePrimitive.java @@ -26,83 +26,83 @@ package pl.edu.mimuw.cloudatlas.model; /** * Convenient class for types that just wrap ordinary Java types. - * + * * @see TypeCollection */ public class TypePrimitive extends Type { - /** - * Boolean type. - */ - public static final TypePrimitive BOOLEAN = new TypePrimitive(PrimaryType.BOOLEAN); - - /** - * Contact type. - */ - public static final TypePrimitive CONTACT = new TypePrimitive(PrimaryType.CONTACT); - - /** - * Double type. - */ - public static final TypePrimitive DOUBLE = new TypePrimitive(PrimaryType.DOUBLE); - - /** - * Duration type. - */ - public static final TypePrimitive DURATION = new TypePrimitive(PrimaryType.DURATION); - - /** - * Integer type. - */ - public static final TypePrimitive INTEGER = new TypePrimitive(PrimaryType.INT); - - /** - * A special "null type" that represents null value of an unknown type. It can be converted to any other type. - * - * @see Type#isCompatible(Type) - * @see ValueNull - */ - public static final TypePrimitive NULL = new TypePrimitive(PrimaryType.NULL); - - /** - * String type. - */ - public static final TypePrimitive STRING = new TypePrimitive(PrimaryType.STRING); - - /** - * Time type. - */ - public static final TypePrimitive TIME = new TypePrimitive(PrimaryType.TIME); - - private TypePrimitive(PrimaryType primaryType) { - super(primaryType); - switch(primaryType) { - case BOOLEAN: - case CONTACT: - case DOUBLE: - case DURATION: - case INT: - case NULL: - case STRING: - case TIME: - break; - default: - throw new IllegalArgumentException( - "This class can represent a primitive type only (boolean, int etc.)."); - } - } - - /** - * Gets a textual representation of this type. - * - * @return a string representing this type - */ - @Override - public String toString() { - return getPrimaryType().toString(); - } - - @Override - public boolean isCompatible(Type type) { - return super.isCompatible(type) || getPrimaryType() == type.getPrimaryType(); - } + /** + * Boolean type. + */ + public static final TypePrimitive BOOLEAN = new TypePrimitive(PrimaryType.BOOLEAN); + + /** + * Contact type. + */ + public static final TypePrimitive CONTACT = new TypePrimitive(PrimaryType.CONTACT); + + /** + * Double type. + */ + public static final TypePrimitive DOUBLE = new TypePrimitive(PrimaryType.DOUBLE); + + /** + * Duration type. + */ + public static final TypePrimitive DURATION = new TypePrimitive(PrimaryType.DURATION); + + /** + * Integer type. + */ + public static final TypePrimitive INTEGER = new TypePrimitive(PrimaryType.INT); + + /** + * A special "null type" that represents null value of an unknown type. It can be converted to any other type. + * + * @see Type#isCompatible(Type) + * @see ValueNull + */ + public static final TypePrimitive NULL = new TypePrimitive(PrimaryType.NULL); + + /** + * String type. + */ + public static final TypePrimitive STRING = new TypePrimitive(PrimaryType.STRING); + + /** + * Time type. + */ + public static final TypePrimitive TIME = new TypePrimitive(PrimaryType.TIME); + + private TypePrimitive(PrimaryType primaryType) { + super(primaryType); + switch(primaryType) { + case BOOLEAN: + case CONTACT: + case DOUBLE: + case DURATION: + case INT: + case NULL: + case STRING: + case TIME: + break; + default: + throw new IllegalArgumentException( + "This class can represent a primitive type only (boolean, int etc.)."); + } + } + + /** + * Gets a textual representation of this type. + * + * @return a string representing this type + */ + @Override + public String toString() { + return getPrimaryType().toString(); + } + + @Override + public boolean isCompatible(Type type) { + return super.isCompatible(type) || getPrimaryType() == type.getPrimaryType(); + } } |