public class EmptyRowSequence extends java.lang.Object implements RowSplittable, RowAccess
Modifier and Type | Method and Description |
---|---|
void |
close()
Does nothing.
|
java.lang.Object |
getCell(int icol)
Always throws IllegalStateException.
|
static EmptyRowSequence |
getInstance()
Returns singleton instance of this class.
|
java.lang.Object[] |
getRow()
Always throws IllegalStateException.
|
boolean |
next()
Always returns false.
|
java.util.function.LongSupplier |
rowIndex()
Returns a supplier for the index of the row currently being processed,
if possible.
|
void |
setRowIndex(long irow)
Sets the row index to which subsequent data accesses will refer.
|
RowSplittable |
split()
Attempts to partition this object into two halves,
ideally of similar size.
|
long |
splittableSize()
Provides an estimate of the number of processable items in this object.
|
public boolean next()
next
in interface RowSequence
next
in interface Sequence
true
iff this sequence has been advanced to the
next rowpublic void setRowIndex(long irow)
RowAccess
This method must be called before the first invocation of
RowAccess.getCell(int)
/RowAccess.getRow()
, otherwise behaviour is undefined
(but implementations will likely throw an unchecked exception
on subsequent getCell/getRow calls).
The effect of setting the value to an out of range value is undefined;
it may throw an exception here, or during subsequent calls,
or behave otherwise.
setRowIndex
in interface RowAccess
irow
- row indexpublic java.util.function.LongSupplier rowIndex()
RowSplittable
Typically, the row index will start at 0 and increment for each row, but the numbering may be different depending on the requirements of the implementation or usage.
Before the RowSequence.next()
method has been called,
the return value will be one less than the first row index.
After RowSequence.next
has returned false,
the value is undefined.
Depending on the implementation, it may not be possible to determine the row index (for instance if the sequence is split into sub-splittables of unknown size). In such cases, this method returns null. The null-ness of the return value must be the same for all instances of the splittable hierarchy for a given sequence, so don't return a non-null value for the first splittable and then null values for some or all of its children.
rowIndex
in interface RowSplittable
public RowSplittable split()
Splittable
Following a successful call, the two parts may be processed in different threads.
split
in interface Splittable<RowSplittable>
Spliterator.trySplit()
public long splittableSize()
Splittable
If no estimate for the size is available, a negative value should be returned.
splittableSize
in interface Splittable<RowSplittable>
public java.lang.Object getCell(int icol)
public java.lang.Object[] getRow()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface RowAccess
close
in interface RowSequence
public static EmptyRowSequence getInstance()