Class Type
java.lang.Object
com.aquima.interactions.expressions.definition.Type
- All Implemented Interfaces:
Serializable
This object contains the type information which can be associated with an expression.
- Since:
- 5.0
- Author:
- F. van der Meer, O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a type object for all types except 'entity'.Constructs a type object with the type name argument.Constructs a type object with the type name argument.Constructs a type object with the type name argument.Type
(DataType type, String typeName, boolean multivalue, IPrimitiveValue... domain) Constructs a type object with the type name argument. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns the dimension of this type object.This function returns the domain of this type within a certain context ( i.e.static Type
getLeadingType
(Type type1, Type type2) This function will check the leading type when two types are used to return a new type.protected String
getType()
Acquires the integral type of the type object.Returns the type name of this type object when known.int
hashCode()
boolean
isAny()
This function states whether this type is of the 'any' type.boolean
isAssignableTo
(Type other, ITypeEnvironment source) This function checks whether the other type is assignable to this type without losing information.boolean
isAssignableTo
(Type other, ITypeEnvironment source, boolean checkDimension) This function checks whether the other type is assignable to this type without losing information.boolean
A derived type means that the domain is 'determined' by looking at the values, not the definition.boolean
This method indicates the type is a multivalued object.boolean
This method returns a boolean indicating if the type represents a specified type that has not been altered by any operation.boolean
isString()
This function returns true when the type of this type is a string, either multivalued or not.packed()
This returns a multivalue version of this type.toString()
unpacked()
This returns a singlevalue version of this type.
-
Constructor Details
-
Type
Constructs a type object for all types except 'entity'.- Parameters:
type
- The data type of the object.multivalue
- This boolean indicates the type is a multivalued type.
-
Type
Constructs a type object with the type name argument. Type names are only valid for domain and entity-types.- Parameters:
type
- The data type of the object.typeName
- The name of the referred type.multivalue
- This boolean indicates the type is a multivalued type.
-
Type
Constructs a type object with the type name argument. Type names are only valid for domain and entity-types. The type also will contain domain information. ( i.e. the possible value list )- Parameters:
type
- The data type of the object.typeName
- The name of the referred type.multivalue
- This boolean indicates the type is a multivalued type.domain
- The domain for this type.
-
Type
Constructs a type object with the type name argument. Type names are only valid for domain and entity-types. The type also will contain domain information. ( i.e. the possible value list )- Parameters:
type
- The data type of the object.typeName
- The name of the referred type.multivalue
- This boolean indicates the type is a multivalued type.domain
- The domain for this type.
-
Type
Constructs a type object with the type name argument. Type names are only valid for domain and entity-types. The type also will contain domain information. ( i.e. the possible value list )- Parameters:
type
- The data type of the object.typeName
- The name of the referred type.multivalue
- This boolean indicates the type is a multivalued type.domain
- The domain for this type.isDerived
- Boolean indicating if the type was derived.
-
-
Method Details
-
getType
Acquires the integral type of the type object.- Returns:
- The integral data type of this type object which is never null
-
isDerived
public boolean isDerived()A derived type means that the domain is 'determined' by looking at the values, not the definition. A non-derived/specified domain can be a specified domain like [a,b,c] in a studio-domain definition.- Returns:
- Whether the domain is derived (or specified when the method returns false).
-
isSpecified
public boolean isSpecified()This method returns a boolean indicating if the type represents a specified type that has not been altered by any operation.- Returns:
- Boolean indicating if the type represents a specified type from studio.
-
getTypeName
Returns the type name of this type object when known. This is only the case for entity-types and domain-types.- Returns:
- The type name string for this type which is optionally null.
-
isMultivalue
public boolean isMultivalue()This method indicates the type is a multivalued object.- Returns:
- A boolean indicating this is a multivalued type (set).
-
getDimension
public int getDimension()Returns the dimension of this type object. Zero meaning singlevalued, while one means an array/set type. Future versions might have multiple dimension arrays.- Returns:
- The dimension of the type.
-
getDomain
This function returns the domain of this type within a certain context ( i.e. all possible values )- Returns:
- The domain of this type if it is known, null otherwise.
-
equals
-
hashCode
public int hashCode() -
packed
This returns a multivalue version of this type.- Returns:
- A new type representing a multivalue version of the previous type.
-
unpacked
This returns a singlevalue version of this type.- Returns:
- A new type representing a single value version of the previous type.
-
toString
-
getStringRepresentation
-
isAssignableTo
This function checks whether the other type is assignable to this type without losing information.- Parameters:
other
- the other type.source
- The type environment- Returns:
- A boolean indicating the types are compatible
-
isAssignableTo
This function checks whether the other type is assignable to this type without losing information.- Parameters:
other
- the other type.source
- The type environmentcheckDimension
- A boolean indicating it should also check of dimension equality.- Returns:
- A boolean indicating the types are compatible
-
isString
public boolean isString()This function returns true when the type of this type is a string, either multivalued or not.- Returns:
- A boolean indicating this type is a string.
-
getLeadingType
This function will check the leading type when two types are used to return a new type. The type holding the most information will be chosen as the resulting type.- Parameters:
type1
- The first typetype2
- The second type.- Returns:
- The leading type.
-
isAny
public boolean isAny()This function states whether this type is of the 'any' type. It means the type is undefined and will be coercable to all other types.- Returns:
- true when the type is any regardless of dimension.
-