org.freecompany.redline.header

Class AbstractHeader.AbstractEntry<T>

public abstract class AbstractHeader.AbstractEntry<T> extends Object implements Entry<T>

Field Summary
protected intcount
protected intoffset
protected intsize
protected inttag
protected Tvalues
Method Summary
intgetOffset(int offset)
intgetTag()
abstract intgetType()
Returns the data type of this entry.
TgetValues()
voidindex(ByteBuffer index, int position)
Writes the index entry into the provided buffer at the current position.
abstract voidread(ByteBuffer buffer)
Reads this entries value from the provided buffer using the set count.
booleanready()
Returns true if this entry is ready to write, indicated by the presence of a set of values.
voidsetCount(int count)
voidsetOffset(int offset)
voidsetSize(int size)
voidsetTag(AbstractHeader.Tag tag)
voidsetTag(int tag)
voidsetValues(T values)
abstract intsize()
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.
StringtoString()
abstract voidwrite(ByteBuffer data)
Writes this entries index to the index buffer and its values to the output channel provided.

Field Detail

count

protected int count

offset

protected int offset

size

protected int size

tag

protected int tag

values

protected T values

Method Detail

getOffset

public int getOffset(int offset)

getTag

public int getTag()

getType

public abstract int getType()
Returns the data type of this entry.

getValues

public T getValues()

index

public void index(ByteBuffer index, int position)
Writes the index entry into the provided buffer at the current position.

read

public abstract void read(ByteBuffer buffer)
Reads this entries value from the provided buffer using the set count.

ready

public boolean ready()
Returns true if this entry is ready to write, indicated by the presence of a set of values.

setCount

public void setCount(int count)

setOffset

public void setOffset(int offset)

setSize

public void setSize(int size)

setTag

public void setTag(AbstractHeader.Tag tag)

setTag

public void setTag(int tag)

setValues

public void setValues(T values)

size

public 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.

toString

public String toString()

write

public abstract void write(ByteBuffer data)
Writes this entries index to the index buffer and its values to the output channel provided.