public abstract class AbstractArrayBlock extends Object implements Block
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractArrayBlock.ArrayBlockFunction<T> |
| Constructor and Description |
|---|
AbstractArrayBlock() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
apply(AbstractArrayBlock.ArrayBlockFunction<T> function,
int position) |
Block |
copyPositions(int[] positions,
int offset,
int length)
Returns a block containing the specified positions.
|
Block |
copyRegion(int position,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
String |
getEncodingName()
Get the encoding for this block.
|
long |
getEstimatedDataSizeForStats(int position)
Returns the estimated in memory data size for stats of position.
|
<T> T |
getObject(int position,
Class<T> clazz)
Gets an object in the value at
position. |
protected abstract int |
getOffsetBase() |
protected abstract int[] |
getOffsets() |
long |
getPositionsSizeInBytes(boolean[] positions)
Returns the size of of all positions marked true in the positions array.
|
protected abstract Block |
getRawElementBlock() |
Block |
getRegion(int position,
int length)
Returns a block starting at the specified position and extends for the
specified length.
|
long |
getRegionSizeInBytes(int position,
int length)
Returns the size of
block.getRegion(position, length). |
Block |
getSingleValueBlock(int position)
Gets the value at the specified position as a single element block.
|
protected abstract boolean[] |
getValueIsNull() |
boolean |
isNull(int position)
Is the specified position null?
|
boolean |
mayHaveNull()
Is it possible the block may have a null value? If false, the block can not contain
a null, but if true, the block may or may not have a null.
|
void |
writePositionTo(int position,
BlockBuilder blockBuilder)
Appends the value at
position to blockBuilder and close the entry. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbytesCompare, bytesEqual, compareTo, equals, getByte, getInt, getLoadedBlock, getLogicalSizeInBytes, getLong, getLong, getPositionCount, getPositions, getRetainedSizeInBytes, getShort, getSizeInBytes, getSlice, getSliceLength, hash, retainedBytesForEachPart, writeBytesToprotected abstract Block getRawElementBlock()
protected abstract int[] getOffsets()
protected abstract int getOffsetBase()
@Nullable protected abstract boolean[] getValueIsNull()
public String getEncodingName()
BlockgetEncodingName in interface Blockpublic Block copyPositions(int[] positions, int offset, int length)
Blockpositions array
that starts at offset and has length of length.
All specified positions must be valid for this block.
The returned block must be a compact representation of the original block.
copyPositions in interface Blockpublic Block getRegion(int position, int length)
BlockThe region can be a view over this block. If this block is released the region block may also be released. If the region block is released this block may also be released.
public long getRegionSizeInBytes(int position,
int length)
Blockblock.getRegion(position, length).
The method can be expensive. Do not use it outside an implementation of Block.getRegionSizeInBytes in interface Blockpublic long getPositionsSizeInBytes(boolean[] positions)
Blockblock.getRegionSizeInBytes(position, length)
where you mark all positions for the regions first.getPositionsSizeInBytes in interface Blockpublic Block copyRegion(int position, int length)
BlockThe region returned must be a compact representation of the original block, unless their internal representation will be exactly the same. This method is useful for operators that hold on to a range of values without holding on to the entire block.
copyRegion in interface Blockpublic <T> T getObject(int position,
Class<T> clazz)
Blockposition.public void writePositionTo(int position,
BlockBuilder blockBuilder)
Blockposition to blockBuilder and close the entry.writePositionTo in interface Blockpublic Block getSingleValueBlock(int position)
BlockThis method is useful for operators that hold on to a single value without holding on to the entire block.
getSingleValueBlock in interface Blockpublic long getEstimatedDataSizeForStats(int position)
BlockgetEstimatedDataSizeForStats in interface Blockpublic boolean mayHaveNull()
BlockmayHaveNull in interface Blockpublic boolean isNull(int position)
Blockpublic <T> T apply(AbstractArrayBlock.ArrayBlockFunction<T> function, int position)
Copyright © 2012–2019. All rights reserved.