Package com.yahoo.document.update
Class AddValueUpdate
- java.lang.Object
-
- com.yahoo.document.update.ValueUpdate
-
- com.yahoo.document.update.AddValueUpdate
-
public class AddValueUpdate extends ValueUpdate
Value update representing an addition of a value (possibly with an associated weight) to a multi-valued data type.
- Author:
- Einar M R Rosenvinge
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.document.update.ValueUpdate
ValueUpdate.ValueUpdateClassID
-
-
Field Summary
Fields Modifier and Type Field Description protected FieldValue
value
protected java.lang.Integer
weight
-
Fields inherited from class com.yahoo.document.update.ValueUpdate
valueUpdateClassID
-
-
Constructor Summary
Constructors Constructor Description AddValueUpdate(FieldValue key, int weight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldValue
applyTo(FieldValue val)
protected void
checkCompatibility(DataType fieldType)
boolean
equals(java.lang.Object o)
FieldValue
getValue()
Returns the value of this value update.int
getWeight()
Return the associated weight of this value update.int
hashCode()
void
serialize(DocumentUpdateWriter data, DataType superType)
void
setValue(FieldValue value)
Sets the value of this.java.lang.String
toString()
-
Methods inherited from class com.yahoo.document.update.ValueUpdate
createAdd, createAdd, createAddAll, createAddAll, createAssign, createClear, createDecrement, createDecrement, createDivide, createDivide, createIncrement, createIncrement, createMap, createMultiply, createMultiply, createRemove, createRemoveAll, createRemoveAll, getValueUpdateClassID
-
-
-
-
Field Detail
-
value
protected FieldValue value
-
weight
protected java.lang.Integer weight
-
-
Constructor Detail
-
AddValueUpdate
public AddValueUpdate(FieldValue key, int weight)
-
-
Method Detail
-
getValue
public FieldValue getValue()
Returns the value of this value update.- Specified by:
getValue
in classValueUpdate
- Returns:
- the value of this ValueUpdate
- See Also:
DataType
-
setValue
public void setValue(FieldValue value)
Description copied from class:ValueUpdate
Sets the value of this. Ignored by update who have no value- Specified by:
setValue
in classValueUpdate
-
getWeight
public int getWeight()
Return the associated weight of this value update.- Returns:
- the weight of this value update, or 1 if unset
-
applyTo
public FieldValue applyTo(FieldValue val)
- Specified by:
applyTo
in classValueUpdate
-
checkCompatibility
protected void checkCompatibility(DataType fieldType)
- Specified by:
checkCompatibility
in classValueUpdate
-
serialize
public void serialize(DocumentUpdateWriter data, DataType superType)
- Specified by:
serialize
in classValueUpdate
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classValueUpdate
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classValueUpdate
-
toString
public java.lang.String toString()
- Overrides:
toString
in classValueUpdate
-
-