Class RangeIterator.ArrayBacked
java.lang.Object
io.deephaven.engine.rowset.impl.rsp.container.RangeIterator.ArrayBacked
- All Implemented Interfaces:
RangeIterator
- Enclosing interface:
- RangeIterator
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.rowset.impl.rsp.container.RangeIterator
RangeIterator.ArrayBacked, RangeIterator.Single
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
int
end()
End of the current range (exclusive).boolean
hasNext()
Checks if the iterator has more ranges.void
next()
Advance the iterator to the next range.int
next
(short[] buffer, int offset, int maxShortCount) Get the next batch of ranges.int
start()
Start of the current range.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.rowset.impl.rsp.container.RangeIterator
forEachRange
-
Constructor Details
-
ArrayBacked
public ArrayBacked(int[] ranges)
-
-
Method Details
-
copy
-
hasNext
public boolean hasNext()Description copied from interface:RangeIterator
Checks if the iterator has more ranges. If hasNext() returns false, calling next thereafter results in undefined behavior.- Specified by:
hasNext
in interfaceRangeIterator
- Returns:
- whether there is another range.
-
start
public int start()Description copied from interface:RangeIterator
Start of the current range.Calling start() without calling next() at least once results in undefined behavior.
- Specified by:
start
in interfaceRangeIterator
- Returns:
- the start of the current range.
-
end
public int end()Description copied from interface:RangeIterator
End of the current range (exclusive).Calling end() without calling next() at least once results in undefined behavior.
- Specified by:
end
in interfaceRangeIterator
- Returns:
- the end of the current range (exclusive).
-
next
public void next()Description copied from interface:RangeIterator
Advance the iterator to the next range. Only call after hasNext() has returned true.- Specified by:
next
in interfaceRangeIterator
-
next
public int next(short[] buffer, int offset, int maxShortCount) Description copied from interface:RangeIterator
Get the next batch of ranges.- Specified by:
next
in interfaceRangeIterator
- Parameters:
buffer
- a short array where consecutive pairs of (start, end-1) values will be stored.offset
- where in buffer to start storing range boundary values.maxShortCount
- maximum number of ranges that can be written to buffer;buffer
should have at least space for2*maxRanges
shorts starting atoffset
.- Returns:
- how many ranges were written in
buffer
; this is two times the individual elements written.
-