public abstract class AbstractFixedWidthBlock extends Object implements Block
Modifier and Type | Field and Description |
---|---|
protected int |
fixedSize |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFixedWidthBlock(int fixedSize) |
Modifier and Type | Method and Description |
---|---|
int |
bytesCompare(int position,
int offset,
int length,
io.airlift.slice.Slice otherSlice,
int otherOffset,
int otherLength)
Compares the byte sequences at
offset in the value at position
to the byte sequence at otherOffset in otherSlice . |
boolean |
bytesEqual(int position,
int offset,
io.airlift.slice.Slice otherSlice,
int otherOffset,
int length)
Is the byte sequences at
offset in the value at position equal
to the byte sequence at otherOffset in otherSlice . |
protected void |
checkReadablePosition(int position) |
int |
compareTo(int position,
int offset,
int length,
Block otherBlock,
int otherPosition,
int otherOffset,
int otherLength)
Compares the byte sequences at
offset in the value at position
to the byte sequence at otherOffset in the value at otherPosition
in otherBlock . |
boolean |
equals(int position,
int offset,
Block otherBlock,
int otherPosition,
int otherOffset,
int length)
Is the byte sequences at
offset in the value at position equal
to the byte sequence at otherOffset in the value at otherPosition
in otherBlock . |
byte |
getByte(int position,
int offset)
Gets a byte at
offset in the value at position . |
BlockEncoding |
getEncoding()
Get the encoding for this block.
|
int |
getFixedSize() |
int |
getInt(int position,
int offset)
Gets a little endian int at
offset in the value at position . |
long |
getLong(int position,
int offset)
Gets a little endian long at
offset in the value at position . |
protected abstract io.airlift.slice.Slice |
getRawSlice() |
long |
getRegionSizeInBytes(int positionOffset,
int length)
Returns the logical size of
block.getRegion(position, length) in memory. |
short |
getShort(int position,
int offset)
Gets a little endian short at
offset in the value at position . |
Block |
getSingleValueBlock(int position)
Gets the value at the specified position as a single element block.
|
io.airlift.slice.Slice |
getSlice(int position,
int offset,
int length)
Gets a slice at
offset in the value at position . |
int |
getSliceLength(int position)
Gets the length of the value at the
position . |
long |
hash(int position,
int offset,
int length)
Calculates the hash code the byte sequences at
offset in the
value at position . |
protected abstract boolean |
isEntryNull(int position) |
boolean |
isNull(int position)
Is the specified position null?
|
void |
writeBytesTo(int position,
int offset,
int length,
BlockBuilder blockBuilder)
Appends the byte sequences at
offset in the value at position
to blockBuilder . |
void |
writePositionTo(int position,
BlockBuilder blockBuilder)
Appends the value at
position to blockBuilder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
assureLoaded, copyPositions, copyRegion, getObject, getPositionCount, getRegion, getRetainedSizeInBytes, getSizeInBytes, retainedBytesForEachPart
protected abstract io.airlift.slice.Slice getRawSlice()
protected abstract boolean isEntryNull(int position)
public int getFixedSize()
public int getSliceLength(int position)
Block
position
.
This method must be implemented if @{code getSlice} is implemented.getSliceLength
in interface Block
public byte getByte(int position, int offset)
Block
offset
in the value at position
.public short getShort(int position, int offset)
Block
offset
in the value at position
.public int getInt(int position, int offset)
Block
offset
in the value at position
.public long getLong(int position, int offset)
Block
offset
in the value at position
.public io.airlift.slice.Slice getSlice(int position, int offset, int length)
Block
offset
in the value at position
.public boolean equals(int position, int offset, Block otherBlock, int otherPosition, int otherOffset, int length)
Block
offset
in the value at position
equal
to the byte sequence at otherOffset
in the value at otherPosition
in otherBlock
.
This method must be implemented if @{code getSlice} is implemented.public boolean bytesEqual(int position, int offset, io.airlift.slice.Slice otherSlice, int otherOffset, int length)
Block
offset
in the value at position
equal
to the byte sequence at otherOffset
in otherSlice
.
This method must be implemented if @{code getSlice} is implemented.bytesEqual
in interface Block
public long hash(int position, int offset, int length)
Block
offset
in the
value at position
.
This method must be implemented if @{code getSlice} is implemented.public int compareTo(int position, int offset, int length, Block otherBlock, int otherPosition, int otherOffset, int otherLength)
Block
offset
in the value at position
to the byte sequence at otherOffset
in the value at otherPosition
in otherBlock
.
This method must be implemented if @{code getSlice} is implemented.public int bytesCompare(int position, int offset, int length, io.airlift.slice.Slice otherSlice, int otherOffset, int otherLength)
Block
offset
in the value at position
to the byte sequence at otherOffset
in otherSlice
.
This method must be implemented if @{code getSlice} is implemented.bytesCompare
in interface Block
public void writeBytesTo(int position, int offset, int length, BlockBuilder blockBuilder)
Block
offset
in the value at position
to blockBuilder
.
This method must be implemented if @{code getSlice} is implemented.writeBytesTo
in interface Block
public void writePositionTo(int position, BlockBuilder blockBuilder)
Block
position
to blockBuilder
.writePositionTo
in interface Block
public BlockEncoding getEncoding()
Block
getEncoding
in interface Block
public Block getSingleValueBlock(int position)
Block
This method is useful for operators that hold on to a single value without holding on to the entire block.
getSingleValueBlock
in interface Block
public boolean isNull(int position)
Block
public long getRegionSizeInBytes(int positionOffset, int length)
Block
block.getRegion(position, length)
in memory.getRegionSizeInBytes
in interface Block
protected void checkReadablePosition(int position)
Copyright © 2012-2017. All Rights Reserved.