Class Percentage
java.lang.Object
com.aquima.interactions.foundation.types.AbstractValue
com.aquima.interactions.foundation.types.NumberValue
com.aquima.interactions.foundation.types.Percentage
- All Implemented Interfaces:
IConvertable
,IPrimitiveValue
,ISingleValue
,IValue
,Serializable
,Comparable<Object>
- Direct Known Subclasses:
AttributePercentage
This class holds a single percentage value.
- Since:
- 5.0
- Author:
- O. Kerpershoek
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Percentage
This member defines the UNKNOWN value for the percentage type.Fields inherited from class com.aquima.interactions.foundation.types.NumberValue
EQUALS_MARGIN
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Percentage
(double doubleValue) Percentage
(IMultilingualText displayValue, double doubleValue) Constructs the Percentage with a display text.Percentage
(Percentage other) Copy constructor.Percentage
(String typeName, IMultilingualText displayValue, double doubleValue) Constructs the Percentage as a domain value. -
Method Summary
Modifier and TypeMethodDescriptionforType
(String typeName, IMultilingualText displayValue) This method adds the type and display information to the value, and returns the value with this added information.This method returns the data type of the value.static double
parsePercentage
(Object obj) toString()
static NumberValue
Methods inherited from class com.aquima.interactions.foundation.types.NumberValue
booleanValue, compareSimple, contains, dateValue, doubleCompare, doubleValue, duplicate, equals, getValue, hashCode, integerValue, isUnknown, longValue, parseDouble, stringValue
Methods inherited from class com.aquima.interactions.foundation.types.AbstractValue
compareTo, getDisplayValue, getTypeName, isRangeValue, isSingleValue, toListValue, toRangeValue, toSingleValue
-
Field Details
-
UNKNOWN
This member defines the UNKNOWN value for the percentage type.
-
-
Constructor Details
-
Percentage
protected Percentage() -
Percentage
Copy constructor.- Parameters:
other
- value to copy.
-
Percentage
public Percentage(double doubleValue) -
Percentage
Constructs the Percentage with a display text.- Parameters:
displayValue
- Text object containing the display value that should be used.doubleValue
- a double containing the actual value.
-
Percentage
Constructs the Percentage as a domain value.- Parameters:
typeName
- The name of the domain the value belongs to.displayValue
- Text object containing the display value that should be used.doubleValue
- a double containing the actual value.
-
-
Method Details
-
valueOf
-
parsePercentage
-
forType
Description copied from interface:IPrimitiveValue
This method adds the type and display information to the value, and returns the value with this added information. The method will not change the state of the value the method is invoked on, but it will return a copy of the current value with the added information.- Specified by:
forType
in interfaceIPrimitiveValue
- Overrides:
forType
in classNumberValue
- Parameters:
typeName
- The type of the value.displayValue
- Multilingual text containing display values.- Returns:
- The value with the added information.
-
getDataType
Description copied from interface:IValue
This method returns the data type of the value.- Specified by:
getDataType
in interfaceIValue
- Overrides:
getDataType
in classNumberValue
- Returns:
- The data type of the value.
-
toString
- Overrides:
toString
in classNumberValue
-