|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.data.Value
public class Value
A byte sequence that is usable as a key or value. Based on BytesWritable
only this class is NOT resizable and DOES NOT
distinguish between the size of the sequence and the current capacity as BytesWritable
does. Hence its comparatively
'immutable'.
Nested Class Summary | |
---|---|
static class |
Value.Comparator
A Comparator optimized for Value. |
Field Summary | |
---|---|
protected byte[] |
value
|
Constructor Summary | |
---|---|
Value()
Create a zero-size sequence. |
|
Value(byte[] bytes)
Create a Value using the byte array as the initial value. |
|
Value(byte[] bytes,
boolean copy)
Create a Value based on the given bytes. |
|
Value(byte[] newData,
int offset,
int length)
Set the value to a copy of the given byte range |
|
Value(ByteBuffer bytes)
Create a Value using a copy of the ByteBuffer's content. |
|
Value(ByteBuffer bytes,
boolean copy)
Deprecated. A copy of the bytes in the buffer is always made. Use Value(ByteBuffer) instead. |
|
Value(Value ibw)
Set the new Value to a copy of the contents of the passed ibw . |
Method Summary | |
---|---|
int |
compareTo(byte[] that)
Compares the bytes in this object to the specified byte array |
int |
compareTo(Object right_obj)
Define the sort order of the BytesWritable. |
void |
copy(byte[] b)
|
boolean |
equals(Object right_obj)
|
byte[] |
get()
|
int |
getSize()
|
int |
hashCode()
|
void |
readFields(DataInput in)
|
void |
set(byte[] b)
|
static byte[][] |
toArray(List<byte[]> array)
|
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected byte[] value
Constructor Detail |
---|
public Value()
public Value(byte[] bytes)
bytes
- May not be nullpublic Value(ByteBuffer bytes)
bytes
- May not be null@Deprecated public Value(ByteBuffer bytes, boolean copy)
Value(ByteBuffer)
instead.
bytes
- may not be nullpublic Value(byte[] bytes, boolean copy)
bytes
- may not be nullcopy
- signal if Value must make its own copy of bytes, or if it can use the array directly.public Value(Value ibw)
ibw
.
ibw
- may not be null.public Value(byte[] newData, int offset, int length)
newData
- source of copy, may not be nulloffset
- the offset in newData to start atlength
- the number of bytes to copyMethod Detail |
---|
public byte[] get()
public void set(byte[] b)
b
- Use passed bytes as backing array for this instance, may not be null.public void copy(byte[] b)
b
- copy the given byte array, may not be null.public int getSize()
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int hashCode()
hashCode
in class Object
public int compareTo(Object right_obj)
compareTo
in interface Comparable<Object>
right_obj
- The other bytes writable
public int compareTo(byte[] that)
public boolean equals(Object right_obj)
equals
in class Object
public String toString()
toString
in class Object
public static byte[][] toArray(List<byte[]> array)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |