Class PrimitiveDataType

java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.document.DataType
com.yahoo.document.PrimitiveDataType
All Implemented Interfaces:
Cloneable, Comparable<DataType>
Direct Known Subclasses:
NumericDataType

public class PrimitiveDataType extends DataType
Author:
Einar M R Rosenvinge
  • Field Details

    • classId

      public static final int classId
  • Constructor Details

    • PrimitiveDataType

      protected PrimitiveDataType(String name, int code, Class<? extends FieldValue> valueClass, PrimitiveDataType.Factory factory)
      Creates a datatype
      Parameters:
      name - the name of the type
      code - the code (id) of the type
      factory - the factory for creating field values of this type
  • Method Details

    • clone

      public PrimitiveDataType clone()
      Overrides:
      clone in class DataType
    • createFieldValue

      public FieldValue createFieldValue()
      Description copied from class: DataType
      Creates a new, empty FieldValue of this type
      Specified by:
      createFieldValue in class DataType
    • createFieldValue

      public FieldValue createFieldValue(Object arg)
      Description copied from class: DataType
      Creates a new FieldValue of this type, with the given value.
      Overrides:
      createFieldValue in class DataType
      Parameters:
      arg - the value of the new FieldValue
      Returns:
      a new FieldValue of this type, with the given value
    • getValueClass

      public Class<? extends FieldValue> getValueClass()
      Specified by:
      getValueClass in class DataType
    • isValueCompatible

      public boolean isValueCompatible(FieldValue value)
      Specified by:
      isValueCompatible in class DataType
    • getPrimitiveType

      public PrimitiveDataType getPrimitiveType()
      Description copied from class: DataType
      Returns the primitive datatype associated with this datatype, i.e. the type itself if this is a PrimitiveDataType, the nested type if this is a CollectionDataType or null for all other cases
      Overrides:
      getPrimitiveType in class DataType
      Returns:
      primitive data type, or null
    • visitMembers

      public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
      Overrides:
      visitMembers in class DataType