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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrimitiveDataType(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. the type itself if this is a PrimitiveDataType, the nested type if this is a CollectionDataType or null for all other casesClass<? extends FieldValue>booleanisValueCompatible(FieldValue value) voidvisitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) Methods inherited from class com.yahoo.document.DataType
buildFieldPath, compareTo, createByReflection, equals, getArray, getCode, getId, getMap, getName, getNestedType, getTensor, getWeightedSet, getWeightedSet, hashCode, isAssignableFrom, isAssignableTo, isMultivalue, isRegistered, lastPredefinedDataTypeId, register, register, setId, setName, toStringMethods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, onDeserialize, onGetClassId, onSerialize, putUtf8, registerClass, registerClass, serialize, serializeOptional, serializeWithIdMethods 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:DataTypeCreates a new, empty FieldValue of this type- Specified by:
createFieldValuein classDataType
-
createFieldValue
Description copied from class:DataTypeCreates a new FieldValue of this type, with the given value.- Overrides:
createFieldValuein classDataType- Parameters:
arg- the value of the new FieldValue- Returns:
- a new FieldValue of this type, with the given value
-
getValueClass
- Specified by:
getValueClassin classDataType
-
isValueCompatible
- Specified by:
isValueCompatiblein classDataType
-
getPrimitiveType
Description copied from class:DataTypeReturns 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:
getPrimitiveTypein classDataType- Returns:
- primitive data type, or null
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) - Overrides:
visitMembersin classDataType
-