public class VariableWidthCursor extends Object implements BlockCursor
| Constructor and Description |
|---|
VariableWidthCursor(VariableWidthCursor cursor) |
VariableWidthCursor(VariableWidthType type,
int positionCount,
io.airlift.slice.Slice slice,
int[] offsets) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
advanceNextPosition()
Attempts to advance to the next position in this stream.
|
boolean |
advanceToPosition(int newPosition)
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.
|
VariableWidthCursor |
duplicate()
Creates a new cursor at the same position of as this cursor.
|
int |
entrySize() |
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.
|
public VariableWidthCursor(VariableWidthType type, int positionCount, io.airlift.slice.Slice slice, int[] offsets)
public VariableWidthCursor(VariableWidthCursor cursor)
public VariableWidthCursor duplicate()
BlockCursorduplicate in interface BlockCursorpublic Type getType()
BlockCursorgetType in interface BlockCursorpublic int getRemainingPositions()
BlockCursorgetRemainingPositions in interface BlockCursorpublic boolean isValid()
BlockCursorisValid in interface BlockCursorpublic boolean isFinished()
BlockCursorisFinished in interface BlockCursorpublic boolean advanceNextPosition()
BlockCursoradvanceNextPosition in interface BlockCursorpublic boolean advanceToPosition(int newPosition)
BlockCursoradvanceToPosition in interface BlockCursorpublic Block getRegionAndAdvance(int length)
BlockCursorCursor cursor = ...;
<p/>
while (cursor.getRemainingPositions() > 0) {
Block block = cursor.getRegionAndAdvance(1024);
...
}
getRegionAndAdvance in interface BlockCursorpublic int getPosition()
BlockCursorgetPosition in interface BlockCursorpublic Block getSingleValueBlock()
BlockCursorgetSingleValueBlock in interface BlockCursorpublic boolean getBoolean()
BlockCursorgetBoolean in interface BlockCursorpublic long getLong()
BlockCursorgetLong in interface BlockCursorpublic double getDouble()
BlockCursorgetDouble in interface BlockCursorpublic io.airlift.slice.Slice getSlice()
BlockCursorgetSlice in interface BlockCursorpublic Object getObjectValue(ConnectorSession session)
BlockCursorgetObjectValue in interface BlockCursorpublic boolean isNull()
BlockCursorisNull in interface BlockCursorpublic int compareTo(io.airlift.slice.Slice otherSlice,
int otherOffset)
BlockCursorcompareTo in interface BlockCursorpublic int hash()
BlockCursorhash in interface BlockCursorpublic void appendTo(BlockBuilder blockBuilder)
BlockCursorappendTo in interface BlockCursorpublic int entrySize()
Copyright © 2012-2014. All Rights Reserved.