Package com.yahoo.searchlib.aggregation
Class RawData
- java.lang.Object
-
- com.yahoo.searchlib.aggregation.RawData
-
- All Implemented Interfaces:
Cloneable
,Comparable<RawData>
public class RawData extends Object implements Cloneable, Comparable<RawData>
A byte array a a cloneable and comparable object. It also implements a sanehashCode()
andtoString()
.- Author:
- Simon Thoresen Hult
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
static int
compare(byte[] lhs, byte[] rhs)
Implements comparison of two byte arrays.int
compareTo(RawData rhs)
void
deserialize(com.yahoo.vespa.objects.Deserializer buf)
Deserializes the content for this data from the given byte buffer.boolean
equals(Object obj)
byte[]
getData()
Returns the byte array that constitutes this data.int
hashCode()
void
serialize(com.yahoo.vespa.objects.Serializer buf)
Serializes the content of this data into the given byte buffer.RawData
setData(byte[] data)
Sets the byte array that constitutes this data.String
toString()
-
-
-
Method Detail
-
serialize
public void serialize(com.yahoo.vespa.objects.Serializer buf)
Serializes the content of this data into the given byte buffer.- Parameters:
buf
- the buffer to serialize to
-
deserialize
public void deserialize(com.yahoo.vespa.objects.Deserializer buf)
Deserializes the content for this data from the given byte buffer.- Parameters:
buf
- the buffer to deserialize from
-
getData
public byte[] getData()
Returns the byte array that constitutes this data.- Returns:
- the byte array
-
setData
public RawData setData(byte[] data)
Sets the byte array that constitutes this data. This does not copy the given array, it simply assigns it to this.- Parameters:
data
- the data to set- Returns:
- this, to allow chaining
-
compareTo
public int compareTo(RawData rhs)
- Specified by:
compareTo
in interfaceComparable<RawData>
-
compare
public static int compare(byte[] lhs, byte[] rhs)
Implements comparison of two byte arrays.- Parameters:
lhs
- the left-hand-side of the comparisonrhs
- the right-hand-side of the comparison- Returns:
- the result of comparing the two byte arrays
-
-