Package com.yahoo.document
Class CollectionDataType
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.document.DataType
-
- com.yahoo.document.CollectionDataType
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<DataType>
- Direct Known Subclasses:
ArrayDataType
,WeightedSetDataType
public abstract class CollectionDataType extends DataType
- Author:
- Einar M R Rosenvinge
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CollectionDataType(String name, int code, DataType nestedType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CollectionDataType
clone()
protected FieldValue
createByReflection(Object arg)
Creates a field value by reflectionabstract CollectionFieldValue<?>
createFieldValue()
Creates a new, empty FieldValue of this typeDataType
getNestedType()
PrimitiveDataType
getPrimitiveType()
Returns the primitive datatype associated with this datatype, i.e.boolean
isMultivalue()
Returns whether this is a multivalue type, i.e either a CollectionDataType or a MapDataTypeboolean
isValueCompatible(FieldValue value)
protected void
register(DocumentTypeManager manager, List<DataType> seenTypes)
void
setNestedType(DataType nestedType)
Sets the nested type of this CollectionDataType. WARNING! Do not use! Only to be used by config system!void
visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
-
Methods inherited from class com.yahoo.document.DataType
buildFieldPath, compareTo, createFieldValue, equals, getArray, getCode, getId, getMap, getName, getTensor, getValueClass, getWeightedSet, getWeightedSet, hashCode, isAssignableFrom, isRegistered, lastPredefinedDataTypeId, register, setId, setName, toString
-
-
-
-
Method Detail
-
createFieldValue
public abstract CollectionFieldValue<?> createFieldValue()
Description copied from class:DataType
Creates a new, empty FieldValue of this type- Specified by:
createFieldValue
in classDataType
-
clone
public CollectionDataType clone()
-
getNestedType
public DataType getNestedType()
-
createByReflection
protected FieldValue createByReflection(Object arg)
Description copied from class:DataType
Creates a field value by reflection- Overrides:
createByReflection
in classDataType
- Parameters:
arg
- the value of the newly created field value- Returns:
- a fully constructed value
-
setNestedType
public void setNestedType(DataType nestedType)
Sets the nested type of this CollectionDataType. WARNING! Do not use! Only to be used by config system!
-
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
-
isValueCompatible
public boolean isValueCompatible(FieldValue value)
- Specified by:
isValueCompatible
in classDataType
-
register
protected void register(DocumentTypeManager manager, List<DataType> seenTypes)
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
- Overrides:
visitMembers
in classDataType
-
isMultivalue
public boolean isMultivalue()
Description copied from class:DataType
Returns whether this is a multivalue type, i.e either a CollectionDataType or a MapDataType- Overrides:
isMultivalue
in classDataType
-
-