Package com.yahoo.document
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:
Serializable
,Cloneable
,Comparable<DataType>
- Direct Known Subclasses:
NumericDataType
public class PrimitiveDataType extends DataType
- Author:
- Einar M R Rosenvinge
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PrimitiveDataType.Factory
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrimitiveDataType(String name, int code, Class<? extends FieldValue> valueClass, PrimitiveDataType.Factory factory)
Creates a datatype
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimitiveDataType
clone()
FieldValue
createFieldValue()
Creates a new, empty FieldValue of this typePrimitiveDataType
getPrimitiveType()
Returns the primitive datatype associated with this datatype, i.e.Class<? extends FieldValue>
getValueClass()
boolean
isValueCompatible(FieldValue value)
void
visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
-
Methods inherited from class com.yahoo.document.DataType
buildFieldPath, compareTo, createByReflection, createFieldValue, equals, getArray, getCode, getId, getMap, getName, getTensor, getWeightedSet, getWeightedSet, hashCode, isAssignableFrom, isMultivalue, isRegistered, lastPredefinedDataTypeId, register, register, setId, setName, toString
-
-
-
-
Constructor Detail
-
PrimitiveDataType
protected PrimitiveDataType(String name, int code, Class<? extends FieldValue> valueClass, PrimitiveDataType.Factory factory)
Creates a datatype- Parameters:
name
- the name of the typecode
- the code (id) of the typefactory
- the factory for creating field values of this type
-
-
Method Detail
-
clone
public PrimitiveDataType clone()
-
createFieldValue
public FieldValue createFieldValue()
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classDataType
-
getValueClass
public Class<? extends FieldValue> getValueClass()
- Specified by:
getValueClass
in classDataType
-
isValueCompatible
public boolean isValueCompatible(FieldValue value)
- Specified by:
isValueCompatible
in classDataType
-
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 classDataType
- Returns:
- primitive data type, or null
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
- Overrides:
visitMembers
in classDataType
-
-