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:
Cloneable
,Comparable<DataType>
- Direct Known Subclasses:
NumericDataType
- Author:
- Einar M R Rosenvinge
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
PrimitiveDataType
(String name, int code, Class<? extends FieldValue> valueClass, PrimitiveDataType.Factory factory) Creates a datatype -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a new, empty FieldValue of this typecreateFieldValue
(Object arg) Creates a new FieldValue of this type, with the given value.Returns the primitive datatype associated with this datatype, i.e.Class<? extends FieldValue>
boolean
isValueCompatible
(FieldValue value) void
visitMembers
(com.yahoo.vespa.objects.ObjectVisitor visitor) Methods inherited from class com.yahoo.document.DataType
buildFieldPath, compareTo, createByReflection, equals, getArray, getCode, getId, getMap, getName, getTensor, getWeightedSet, getWeightedSet, hashCode, isAssignableFrom, isMultivalue, isRegistered, lastPredefinedDataTypeId, register, register, setId, setName, toString
Methods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, onDeserialize, onGetClassId, onSerialize, putUtf8, registerClass, serialize, serializeOptional, serializeWithId
Methods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
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 typecode
- the code (id) of the typefactory
- the factory for creating field values of this type
-
-
Method Details
-
clone
-
createFieldValue
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classDataType
-
createFieldValue
Description copied from class:DataType
Creates a new FieldValue of this type, with the given value.- Overrides:
createFieldValue
in classDataType
- Parameters:
arg
- the value of the new FieldValue- Returns:
- a new FieldValue of this type, with the given value
-
getValueClass
- Specified by:
getValueClass
in classDataType
-
isValueCompatible
- Specified by:
isValueCompatible
in classDataType
-
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
-