public abstract class AbstractHeader.AbstractEntry<T> extends Object implements AbstractHeader.Entry<T>
| Modifier and Type | Field and Description |
|---|---|
protected int |
count |
protected int |
offset |
protected int |
size |
protected int |
tag |
protected T |
values |
| Constructor and Description |
|---|
AbstractEntry() |
| Modifier and Type | Method and Description |
|---|---|
int |
getOffset(int offset) |
int |
getTag() |
abstract int |
getType()
Returns the data type of this entry.
|
T |
getValues() |
void |
index(ByteBuffer index,
int position)
Writes the index entry into the provided buffer at the current position.
|
abstract void |
read(ByteBuffer buffer)
Reads this entries value from the provided buffer using the set count.
|
boolean |
ready()
Returns true if this entry is ready to write, indicated by the presence of
a set of values.
|
void |
setCount(int count) |
void |
setOffset(int offset) |
void |
setSize(int size) |
void |
setTag(AbstractHeader.Tag tag) |
void |
setTag(int tag) |
void |
setValues(T values) |
abstract int |
size()
Returns the size this entry will need in the provided data buffer to write
it's contents, corrected for any trailing zeros to fill to a boundary.
|
String |
toString() |
abstract void |
write(ByteBuffer data)
Writes this entries index to the index buffer and its values to the output
channel provided.
|
protected int size
protected int tag
protected int count
protected int offset
protected T values
public void setTag(AbstractHeader.Tag tag)
public void setTag(int tag)
setTag in interface AbstractHeader.Entry<T>public void setSize(int size)
setSize in interface AbstractHeader.Entry<T>public void setCount(int count)
setCount in interface AbstractHeader.Entry<T>public void setOffset(int offset)
setOffset in interface AbstractHeader.Entry<T>public void setValues(T values)
setValues in interface AbstractHeader.Entry<T>public T getValues()
getValues in interface AbstractHeader.Entry<T>public int getTag()
getTag in interface AbstractHeader.Entry<T>public int getOffset(int offset)
getOffset in interface AbstractHeader.Entry<T>public boolean ready()
ready in interface AbstractHeader.Entry<T>public abstract int getType()
getType in interface AbstractHeader.Entry<T>public abstract int size()
size in interface AbstractHeader.Entry<T>public abstract void read(ByteBuffer buffer)
read in interface AbstractHeader.Entry<T>public abstract void write(ByteBuffer data)
write in interface AbstractHeader.Entry<T>public void index(ByteBuffer index, int position)
index in interface AbstractHeader.Entry<T>Copyright © 2015. All Rights Reserved.