Package org.jpmml.evaluator
Class FieldValue
- java.lang.Object
-
- org.jpmml.evaluator.FieldValue
-
- All Implemented Interfaces:
Serializable,TypeInfo
- Direct Known Subclasses:
CollectionValue,ScalarValue
public abstract class FieldValue extends Object implements TypeInfo, Serializable
A field value representation that meets the requirements of PMML type system.
Type information has two components to it:Operational type. Determines supported type equality and type comparison operations.Data type. Determines supported type conversions.
A field value is created after a
field. It may be later refined bytransformationsandfunctions.- See Also:
FieldValueUtil, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BooleanasBoolean()Collection<?>asCollection()org.jpmml.model.temporals.DateasDate()org.jpmml.model.temporals.DateTimeasDateTime()DoubleasDouble()Getting the value of a field asDouble:FloatasFloat()org.jpmml.model.temporals.Instant<?>asInstant()IntegerasInteger()NumberasNumber()StringasString()org.jpmml.model.temporals.TimeasTime()FieldValuecast(org.dmg.pmml.HasType<?> hasType)FieldValuecast(TypeInfo typeInfo)intcompareTo(org.dmg.pmml.HasValue<?> hasValue)Calculates the order between this value and the reference value.abstract intcompareToValue(Object value)abstract intcompareToValue(FieldValue value)static FieldValuecreate(org.dmg.pmml.OpType opType, org.dmg.pmml.DataType dataType, Object value)static FieldValuecreate(TypeInfo typeInfo, Object value)booleanequals(Object object)booleanequals(org.dmg.pmml.HasValue<?> hasValue)Checks if this value is equal to the reference value.booleanequalsValue(Object value)booleanequalsValue(FieldValue value)org.dmg.pmml.DataTypegetDataType()ObjectgetValue()inthashCode()booleanisIn(Collection<FieldValue> values)booleanisIn(org.dmg.pmml.HasValueSet<?> hasValueSet)Checks if this value is contained in the set of reference values.abstract booleanisValid()StringtoString()-
Methods inherited from interface org.jpmml.evaluator.TypeInfo
getOpType, getOrdering
-
-
-
-
Method Detail
-
isValid
public abstract boolean isValid()
-
compareToValue
public abstract int compareToValue(Object value)
-
compareToValue
public abstract int compareToValue(FieldValue value)
-
cast
public FieldValue cast(org.dmg.pmml.HasType<?> hasType)
-
cast
public FieldValue cast(TypeInfo typeInfo)
-
compareTo
public int compareTo(org.dmg.pmml.HasValue<?> hasValue)
Calculates the order between this value and the reference value.
-
equals
public boolean equals(org.dmg.pmml.HasValue<?> hasValue)
Checks if this value is equal to the reference value.
-
isIn
public boolean isIn(org.dmg.pmml.HasValueSet<?> hasValueSet)
Checks if this value is contained in the set of reference values.
-
isIn
public boolean isIn(Collection<FieldValue> values)
-
equalsValue
public boolean equalsValue(Object value)
-
equalsValue
public boolean equalsValue(FieldValue value)
-
asCollection
public Collection<?> asCollection()
-
asString
public String asString()
-
asNumber
public Number asNumber()
-
asInteger
public Integer asInteger()
-
asFloat
public Float asFloat()
-
asDouble
public Double asDouble()
Getting the value of a field asDouble:FieldValue value = ...; Double result = value.asDouble();
Getting the value of a field asdouble:FieldValue value = ...; double result = (value.asNumber()).doubleValue();
- See Also:
asNumber()
-
asBoolean
public Boolean asBoolean()
-
asDate
public org.jpmml.model.temporals.Date asDate()
-
asTime
public org.jpmml.model.temporals.Time asTime()
-
asDateTime
public org.jpmml.model.temporals.DateTime asDateTime()
-
asInstant
public org.jpmml.model.temporals.Instant<?> asInstant()
-
getDataType
public org.dmg.pmml.DataType getDataType()
- Specified by:
getDataTypein interfaceTypeInfo
-
getValue
public Object getValue()
-
create
public static FieldValue create(org.dmg.pmml.OpType opType, org.dmg.pmml.DataType dataType, Object value)
-
create
public static FieldValue create(TypeInfo typeInfo, Object value)
-
-