Class 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 by transformations and functions.

    See Also:
    FieldValueUtil, Serialized Form
    • 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)
      • 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 as Double:
         FieldValue value = ...;
         Double result = value.asDouble();
         
        Getting the value of a field as double:
         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:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringHelper

        protected org.jpmml.model.ToStringHelper toStringHelper()
      • getDataType

        public org.dmg.pmml.DataType getDataType()
        Specified by:
        getDataType in interface TypeInfo
      • 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)