public abstract class AbstractItemAccumulator extends Object implements ItemAccumulator
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractItemAccumulator(StoragePolicy storage,
boolean isNullable)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addDataItem(Object item)
Adds the given item to the list to be output.
|
void |
addItem(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(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(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(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(Object item) throws IOException
addItem(java.lang.Object) method, and is just the hook for the
subclass-specific behaviour.item - cell valueIOExceptionprotected abstract void closeData()
throws IOException
close() method, and is just the hook for the
subclass-specific behaviour.IOExceptionprotected boolean isNull(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(OutputStream out) throws IOException
out - destination streamIOExceptionpublic void close()
throws IOException
ItemAccumulatorclose in interface ItemAccumulatorIOExceptionpublic void addItem(Object item) throws IOException
ItemAccumulatoraddItem in interface ItemAccumulatoritem - column cell valueIOExceptionpublic uk.ac.bristol.star.feather.ColStat writeColumnBytes(OutputStream out) throws IOException
ItemAccumulatoraddItem method.
The number of bytes written must be a multiple of 8.writeColumnBytes in interface ItemAccumulatorout - destination streamIOExceptionCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.