Package org.jpmml.evaluator
Class FieldValue
- java.lang.Object
-
- org.jpmml.evaluator.FieldValue
-
- All Implemented Interfaces:
java.io.Serializable,TypeInfo
- Direct Known Subclasses:
CollectionValue,ScalarValue
public abstract class FieldValue extends java.lang.Object implements TypeInfo, java.io.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 java.lang.BooleanasBoolean()java.util.Collection<?>asCollection()org.jpmml.model.temporals.DateasDate()org.jpmml.model.temporals.DateTimeasDateTime()java.lang.DoubleasDouble()Getting the value of a field asDouble:java.lang.FloatasFloat()org.jpmml.model.temporals.Instant<?>asInstant()java.lang.IntegerasInteger()java.lang.NumberasNumber()java.lang.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(java.lang.Object value)abstract intcompareToValue(FieldValue value)static FieldValuecreate(org.dmg.pmml.OpType opType, org.dmg.pmml.DataType dataType, java.lang.Object value)static FieldValuecreate(TypeInfo typeInfo, java.lang.Object value)booleanequals(java.lang.Object object)booleanequals(org.dmg.pmml.HasValue<?> hasValue)Checks if this value is equal to the reference value.booleanequalsValue(java.lang.Object value)booleanequalsValue(FieldValue value)org.dmg.pmml.DataTypegetDataType()java.lang.ObjectgetValue()inthashCode()booleanisIn(java.util.Collection<FieldValue> values)booleanisIn(org.dmg.pmml.HasValueSet<?> hasValueSet)Checks if this value is contained in the set of reference values.abstract booleanisValid()java.lang.StringtoString()protected org.jpmml.model.ToStringHelpertoStringHelper()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jpmml.evaluator.TypeInfo
getOpType, getOrdering
-
-
-
-
Method Detail
-
isValid
public abstract boolean isValid()
-
compareToValue
public abstract int compareToValue(java.lang.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(java.util.Collection<FieldValue> values)
-
equalsValue
public boolean equalsValue(java.lang.Object value)
-
equalsValue
public boolean equalsValue(FieldValue value)
-
asCollection
public java.util.Collection<?> asCollection()
-
asString
public java.lang.String asString()
-
asNumber
public java.lang.Number asNumber()
-
asInteger
public java.lang.Integer asInteger()
-
asFloat
public java.lang.Float asFloat()
-
asDouble
public java.lang.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 java.lang.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()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringHelper
protected org.jpmml.model.ToStringHelper toStringHelper()
-
getDataType
public org.dmg.pmml.DataType getDataType()
- Specified by:
getDataTypein interfaceTypeInfo
-
getValue
public java.lang.Object getValue()
-
create
public static FieldValue create(org.dmg.pmml.OpType opType, org.dmg.pmml.DataType dataType, java.lang.Object value)
-
create
public static FieldValue create(TypeInfo typeInfo, java.lang.Object value)
-
-