|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable
public class BytesRefArrayWritable
BytesRefArrayWritable holds an array reference to BytesRefWritable, and is able to resize without recreating new array if not necessary.
Each BytesRefArrayWritable holds instance has a valid field, which is the desired valid number of BytesRefWritable it holds. resetValid can reset the valid, but it will not care the underlying BytesRefWritable.
| Constructor Summary | |
|---|---|
BytesRefArrayWritable()
Constructs an empty array with a capacity of ten. |
|
BytesRefArrayWritable(int capacity)
Constructs an empty array with the specified capacity. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all elements. |
int |
compareTo(BytesRefArrayWritable other)
|
boolean |
contains(BytesRefWritable bytesRefWritable)
Returns true if this instance contains one or more the specified BytesRefWritable. |
protected void |
ensureCapacity(int newCapacity)
|
boolean |
equals(Object o)
|
BytesRefWritable |
get(int index)
Gets the BytesRefWritable at the specified position. |
void |
readFields(DataInput in)
|
void |
resetValid(int newValidCapacity)
enlarge the capacity if necessary, to ensure that it can hold the number of elements specified by newValidCapacity argument. |
void |
set(int index,
BytesRefWritable bytesRefWritable)
Set the BytesRefWritable at the specified position with the specified BytesRefWritable. |
int |
size()
Returns the number of valid elements. |
BytesRefWritable |
unCheckedGet(int index)
Gets the BytesRefWritable at the specified position without checking. |
void |
write(DataOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BytesRefArrayWritable(int capacity)
capacity - initial capacity
IllegalArgumentException - if the specified initial capacity is negativepublic BytesRefArrayWritable()
| Method Detail |
|---|
public int size()
public BytesRefWritable get(int index)
index - the position index, starting from zero
IndexOutOfBoundsExceptionpublic BytesRefWritable unCheckedGet(int index)
index - the position index, starting from zero
IndexOutOfBoundsException
public void set(int index,
BytesRefWritable bytesRefWritable)
index - index positionbytesRefWritable - the new element
IllegalArgumentException - if the specified new element is nullpublic int compareTo(BytesRefArrayWritable other)
compareTo in interface Comparable<BytesRefArrayWritable>public boolean contains(BytesRefWritable bytesRefWritable)
bytesRefWritable - BytesRefWritable element to be tested
IllegalArgumentException - if the specified element is nullpublic boolean equals(Object o)
equals in class Objectpublic void clear()
public void resetValid(int newValidCapacity)
newValidCapacity - the desired capacityprotected void ensureCapacity(int newCapacity)
public void readFields(DataInput in)
throws IOException
readFields in interface org.apache.hadoop.io.WritableIOException
public void write(DataOutput out)
throws IOException
write in interface org.apache.hadoop.io.WritableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||