public static class ArrayReaderImpl.ElementReaderIndex extends Object implements ColumnReaderIndex
Indexes allow random or sequential access. Random access is more typical for scalar arrays, while sequential access can be more convenient for tuple arrays.
Modifier and Type | Field and Description |
---|---|
protected ColumnReaderIndex |
base |
protected int |
length |
protected int |
position |
protected int |
startOffset |
Constructor and Description |
---|
ElementReaderIndex(ColumnReaderIndex base) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Reports if the index has another item.
|
int |
hyperVectorIndex()
When used with a hyper-vector (SV4) based batch, returns the
index of the current batch within the hyper-batch.
|
int |
logicalIndex()
Ordinal index within the batch or array.
|
boolean |
next()
Advances the index to the next position.
|
int |
offset()
Given a 0-based index relative to the current array, return an absolute offset
vector location for the array value.
|
void |
reset(int startOffset,
int length)
Reposition this array index for a new array given the array start
offset and length.
|
void |
rewind() |
void |
set(int index)
Set the current iterator location to the given index offset.
|
int |
size()
Return the number of items that this index indexes: top-level record
count for the root index; total element count for nested arrays.
|
protected final ColumnReaderIndex base
protected int startOffset
protected int length
protected int position
public ElementReaderIndex(ColumnReaderIndex base)
public int hyperVectorIndex()
ColumnReaderIndex
hyperVectorIndex
in interface ColumnReaderIndex
public void reset(int startOffset, int length)
startOffset
- first location within the array's
offset vectorlength
- number of offset vector locations associated with this
arraypublic void rewind()
public int size()
ColumnReaderIndex
size
in interface ColumnReaderIndex
public int offset()
offset
in interface ColumnReaderIndex
public boolean next()
ColumnReaderIndex
next
in interface ColumnReaderIndex
public boolean hasNext()
ColumnReaderIndex
hasNext
in interface ColumnReaderIndex
ColumnReaderIndex.next()
would return true.public void set(int index)
index
- 0-based index into the current arraypublic int logicalIndex()
ColumnReaderIndex
logicalIndex
in interface ColumnReaderIndex
Copyright © 1970 The Apache Software Foundation. All rights reserved.