public interface BlockCursor
Cursor cursor = ...;
<p/>
while (cursor.advanceNextPosition()) {
long value = cursor.getLong(...);
...
}
| Modifier and Type | Method and Description |
|---|---|
boolean |
advanceNextPosition()
Attempts to advance to the next position in this stream.
|
boolean |
advanceToPosition(int position)
Attempts to advance to the requested position.
|
void |
appendTo(BlockBuilder blockBuilder)
Appends the value at the current position to the block builder.
|
int |
compareTo(io.airlift.slice.Slice otherSlice,
int otherOffset)
Compares the value at the current position to the value at the other offset
in the other slice.
|
BlockCursor |
duplicate()
Creates a new cursor at the same position of as this cursor.
|
boolean |
getBoolean()
Gets the current value as a boolean.
|
double |
getDouble()
Gets the current value as a double.
|
long |
getLong()
Gets the current value as a long.
|
Object |
getObjectValue(ConnectorSession session)
Gets the current value as an Object.
|
int |
getPosition()
Returns the current position of this cursor.
|
Block |
getRegionAndAdvance(int length)
Creates a block view port starting at the next position and extending
the specified length.
|
int |
getRemainingPositions()
Gets the number of positions remaining in this cursor.
|
Block |
getSingleValueBlock()
Gets the current value as a single element block.
|
io.airlift.slice.Slice |
getSlice()
Gets the current value as a Slice.
|
Type |
getType()
Gets the type of this cursor
|
int |
hash()
Calculates the hash code of the value at the current position.
|
boolean |
isFinished()
Returns true if the cursor has advanced beyond its last position.
|
boolean |
isNull()
Is the current value null?
|
boolean |
isValid()
Returns true if the current position of the cursor is valid; false if
the cursor has not been advanced yet, or if the cursor has advanced
beyond the last position.
|
BlockCursor duplicate()
Type getType()
int getRemainingPositions()
boolean isValid()
boolean isFinished()
boolean advanceNextPosition()
boolean advanceToPosition(int position)
Block getRegionAndAdvance(int length)
Cursor cursor = ...;
<p/>
while (cursor.getRemainingPositions() > 0) {
Block block = cursor.getRegionAndAdvance(1024);
...
}
Block getSingleValueBlock()
IllegalStateException - if this cursor is not at a valid positionboolean getBoolean()
IllegalStateException - if this cursor is not at a valid positionlong getLong()
IllegalStateException - if this cursor is not at a valid positiondouble getDouble()
IllegalStateException - if this cursor is not at a valid positionio.airlift.slice.Slice getSlice()
IllegalStateException - if this cursor is not at a valid positionObject getObjectValue(ConnectorSession session)
session - IllegalStateException - if this cursor is not at a valid positionboolean isNull()
IllegalStateException - if this cursor is not at a valid positionint getPosition()
IllegalStateException - if this cursor is not at a valid positionint compareTo(io.airlift.slice.Slice otherSlice,
int otherOffset)
int hash()
void appendTo(BlockBuilder blockBuilder)
Copyright © 2012-2014. All Rights Reserved.