Package org.faktorips.datatype
Class ListOfTypeDatatype
java.lang.Object
org.faktorips.datatype.AbstractDatatype
org.faktorips.datatype.ListOfTypeDatatype
- All Implemented Interfaces:
Comparable<Datatype>,Datatype,ValueDatatype
Datatype representing a list of objects of a basic datatype.
This datatype is currently only used when navigating associations in expressions. Therefore no
DatatypeHelper exists and this datatype is not usable in attributes.
- Author:
- schwering
- Since:
- 3.6
-
Field Summary
Fields inherited from interface org.faktorips.datatype.Datatype
BIG_DECIMAL, BOOLEAN, DECIMAL, DOUBLE, GREGORIAN_CALENDAR, INTEGER, LONG, MONEY, PRIMITIVE_BOOLEAN, PRIMITIVE_INT, PRIMITIVE_LONG, STRING, VOID -
Constructor Summary
ConstructorsConstructorDescriptionListOfTypeDatatype(Datatype basicType) Constructs a new List type based on the given underlying basic type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanareValuesEqual(String valueA, String valueB) Returnstrueif both given strings represent the same value defined by this datatype.intCompares the values created from the two given strings.Returns the List type's basic type.Returns the datatype's default value.getName()Returns the datatype's name.Returns the datatype's qualified name.Not supported yet.If this datatype represents a primitive type, this method returns the datatype that represents the wrapper class.booleanReturnstrueif this datatype is an abstract datatype in means of the object oriented paradigm.booleanReturnstrueif this is an immutable datatype,falseotherwise.booleanReturnstrueif this is a mutable datatype,falseif it is an immutable datatype.booleanReturnstrueif the given string isnullor the representation of the null object (if the datatype value class makes use of the null object pattern.)booleanisParsable(String value) Not supported yet. Always returnsfalse.booleanReturnstrueif this datatype represents one of Java's primitive types.booleanReturnstrueif this datatype represents values.booleanmatchDatatype(Datatype datatype) Returns true if the dataType is instance of AnyDatatype otherwise it callAbstractDatatype.equals(Object).booleanMethods inherited from class org.faktorips.datatype.AbstractDatatype
checkReadyToUse, compareTo, equals, hashCode, hasNullObject, isEnum, isVoid, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.faktorips.datatype.Datatype
hasNullObject, isEnum, isVoidMethods inherited from interface org.faktorips.datatype.ValueDatatype
checkReadyToUse, getNullObjectId, valueToString
-
Constructor Details
-
ListOfTypeDatatype
Constructs a new List type based on the given underlying basic type.
-
-
Method Details
-
getBasicDatatype
Returns the List type's basic type. E.g. for a list of policy values,Policyis the basic type. -
isImmutable
public boolean isImmutable()Description copied from interface:ValueDatatypeReturnstrueif this is an immutable datatype,falseotherwise.- Specified by:
isImmutablein interfaceValueDatatype- Returns:
- whether this is an immutable datatype
-
isMutable
public boolean isMutable()Description copied from interface:ValueDatatypeReturnstrueif this is a mutable datatype,falseif it is an immutable datatype.- Specified by:
isMutablein interfaceValueDatatype- Returns:
- whether this is a mutable datatype
-
getName
Description copied from interface:DatatypeReturns the datatype's name. -
getQualifiedName
Description copied from interface:DatatypeReturns the datatype's qualified name.The qualified name identifies the datatype.
- Specified by:
getQualifiedNamein interfaceDatatype
-
isPrimitive
public boolean isPrimitive()Description copied from interface:DatatypeReturnstrueif this datatype represents one of Java's primitive types.- Specified by:
isPrimitivein interfaceDatatype
-
isAbstract
public boolean isAbstract()Description copied from interface:DatatypeReturnstrueif this datatype is an abstract datatype in means of the object oriented paradigm.- Specified by:
isAbstractin interfaceDatatype
-
getDefaultValue
Description copied from interface:ValueDatatypeReturns the datatype's default value. For datatypes representing objects the method returnsnull. For datatypes representing Java primitives the Java default value is returned, e.g. 0 for int.- Specified by:
getDefaultValuein interfaceValueDatatype- See Also:
-
isValueDatatype
public boolean isValueDatatype()Description copied from interface:DatatypeReturnstrueif this datatype represents values.If the method returns
true, the datatype can be safely casted toValueDatatype.- Specified by:
isValueDatatypein interfaceDatatype
-
getWrapperType
Description copied from interface:ValueDatatypeIf this datatype represents a primitive type, this method returns the datatype that represents the wrapper class. Returnsnullif this datatype does not represent a primitive.- Specified by:
getWrapperTypein interfaceValueDatatype
-
isParsable
Not supported yet. Always returnsfalse.- Specified by:
isParsablein interfaceValueDatatype
-
getValue
Not supported yet.- Specified by:
getValuein interfaceValueDatatype- Parameters:
value- the string representation of a value- Returns:
- the value as instance of the class this datatype represents
- Throws:
UnsupportedOperationException- always- See Also:
-
matchDatatype
Description copied from class:AbstractDatatypeReturns true if the dataType is instance of AnyDatatype otherwise it callAbstractDatatype.equals(Object).- Overrides:
matchDatatypein classAbstractDatatype
-
isNull
Description copied from interface:ValueDatatypeReturnstrueif the given string isnullor the representation of the null object (if the datatype value class makes use of the null object pattern.) Returnsfalseotherwise.- Specified by:
isNullin interfaceValueDatatype- See Also:
-
NullObject
-
supportsCompare
public boolean supportsCompare()- Specified by:
supportsComparein interfaceValueDatatype- Returns:
trueif this datatype is able to compare two values.
-
compare
Description copied from interface:ValueDatatypeCompares the values created from the two given strings.- Specified by:
comparein interfaceValueDatatype- Parameters:
valueA- The value to compare to valueBvalueB- The value to compare to valueA- Returns:
- A value less than 0 if valueA is less than valueB, 0 if valueA is equal to valueB and a value greater than 0 if valueA is greater than valueB.
- See Also:
-
areValuesEqual
Description copied from interface:ValueDatatypeReturnstrueif both given strings represent the same value defined by this datatype. The String " 1" (a blank followed by the char '1') and "1" (just the char '1') are equal if the datatype is anInteger, but will not be equal if the datatype is aString.- Specified by:
areValuesEqualin interfaceValueDatatype- Parameters:
valueA- The first parameter to comparevalueB- The second parameter to compare- Returns:
trueif the two values are equal according to the datatype, returnsfalseif they are different.
-