Class RangeIterator.Single
java.lang.Object
com.illumon.iris.db.v2.utils.rsp.container.RangeIterator.Single
- All Implemented Interfaces:
RangeIterator
- Enclosing interface:
- RangeIterator
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.rsp.container.RangeIterator
RangeIterator.ArrayBacked, RangeIterator.Single -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()intend()End of the current range (exclusive).booleanhasNext()Checks if the iterator has more ranges.voidnext()Advance the iterator to the next range.intnext(short[] buffer, int offset, int maxShortCount) Get the next batch of ranges.intstart()Start of the current range.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.utils.rsp.container.RangeIterator
forEachRange
-
Constructor Details
-
Single
public Single(int start, int end)
-
-
Method Details
-
copy
-
hasNext
public boolean hasNext()Description copied from interface:RangeIteratorChecks if the iterator has more ranges. If hasNext() returns false, calling next thereafter results in undefined behavior.- Specified by:
hasNextin interfaceRangeIterator- Returns:
- whether there is another range.
-
start
public int start()Description copied from interface:RangeIteratorStart of the current range.Calling start() without calling next() at least once results in undefined behavior.
- Specified by:
startin interfaceRangeIterator- Returns:
- the start of the current range.
-
end
public int end()Description copied from interface:RangeIteratorEnd of the current range (exclusive).Calling end() without calling next() at least once results in undefined behavior.
- Specified by:
endin interfaceRangeIterator- Returns:
- the end of the current range (exclusive).
-
next
public void next()Description copied from interface:RangeIteratorAdvance the iterator to the next range. Only call after hasNext() has returned true.- Specified by:
nextin interfaceRangeIterator
-
next
public int next(short[] buffer, int offset, int maxShortCount) Description copied from interface:RangeIteratorGet the next batch of ranges.- Specified by:
nextin 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;buffershould have at least space for2*maxRangesshorts starting atoffset.- Returns:
- how many ranges were written in
buffer; this is two times the individual elements written.
-