public abstract class AbstractItemAccumulator extends java.lang.Object implements ItemAccumulator
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractItemAccumulator(StoragePolicy storage,
boolean isNullable)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addDataItem(java.lang.Object item)
Adds the given item to the list to be output.
|
void |
addItem(java.lang.Object item)
Receive the next value in the column.
|
void |
close()
Tidies up resources, in particular discarding any off-heap
temporary storage that may have been allocated.
|
protected abstract void |
closeData()
Releases resources.
|
protected boolean |
isNull(java.lang.Object item)
Tests whether a given added data item is null
(whether it needs to be flagged as null in the validity mask).
|
uk.ac.bristol.star.feather.ColStat |
writeColumnBytes(java.io.OutputStream out)
Writes a feather-format column to the given output stream
representing all the objects submitted by prior valls to
the
addItem method. |
abstract long |
writeDataBytes(java.io.OutputStream out)
Writes the bytes constituting the data stream for this column,
excluding any optional validity mask.
|
protected AbstractItemAccumulator(StoragePolicy storage, boolean isNullable)
storage - storage policy for buffering output dataisNullable - if true, preparations will be made to write
the validity mask; it will only be actually
output if there are some null valuesprotected abstract void addDataItem(java.lang.Object item)
throws java.io.IOException
addItem(java.lang.Object) method, and is just the hook for the
subclass-specific behaviour.item - cell valuejava.io.IOExceptionprotected abstract void closeData()
throws java.io.IOException
close() method, and is just the hook for the
subclass-specific behaviour.java.io.IOExceptionprotected boolean isNull(java.lang.Object item)
isNullable flag was set true at construction time).
The default implementation tests whether the supplied item
is in fact null, but it may be overridden.
item - value to testpublic abstract long writeDataBytes(java.io.OutputStream out)
throws java.io.IOException
out - destination streamjava.io.IOExceptionpublic void close()
throws java.io.IOException
ItemAccumulatorclose in interface ItemAccumulatorjava.io.IOExceptionpublic void addItem(java.lang.Object item)
throws java.io.IOException
ItemAccumulatoraddItem in interface ItemAccumulatoritem - column cell valuejava.io.IOExceptionpublic uk.ac.bristol.star.feather.ColStat writeColumnBytes(java.io.OutputStream out)
throws java.io.IOException
ItemAccumulatoraddItem method.
The number of bytes written must be a multiple of 8.writeColumnBytes in interface ItemAccumulatorout - destination streamjava.io.IOException