Package org.roaringbitmap
Class ArrayContainerCharIterator
- java.lang.Object
-
- org.roaringbitmap.ArrayContainerCharIterator
-
- All Implemented Interfaces:
java.lang.Cloneable
,CharIterator
,PeekableCharIterator
,PeekableCharRankIterator
final class ArrayContainerCharIterator extends java.lang.Object implements PeekableCharRankIterator
-
-
Field Summary
Fields Modifier and Type Field Description private ArrayContainer
parent
(package private) int
pos
-
Constructor Summary
Constructors Constructor Description ArrayContainerCharIterator()
ArrayContainerCharIterator(ArrayContainer p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advanceIfNeeded(char minval)
If needed, when iterating forward through the chars it will advance as long as the next value is smaller than val (as an unsigned short) when iterating in reverse through the chars it will advance as long as the next value is larger than val (as an unsigned short)PeekableCharRankIterator
clone()
Creates a copy of the iterator.boolean
hasNext()
char
next()
int
nextAsInt()
char
peekNext()
Look at the next value without advancingint
peekNextRank()
peek in-container rank of the next value Uses integer because internal representation of rank is int and in-container rank lies in range 1-65536void
remove()
If possible, remove the current value(package private) void
wrap(ArrayContainer p)
-
-
-
Field Detail
-
pos
int pos
-
parent
private ArrayContainer parent
-
-
Constructor Detail
-
ArrayContainerCharIterator
ArrayContainerCharIterator()
-
ArrayContainerCharIterator
ArrayContainerCharIterator(ArrayContainer p)
-
-
Method Detail
-
advanceIfNeeded
public void advanceIfNeeded(char minval)
Description copied from interface:PeekableCharIterator
If needed, when iterating forward through the chars it will advance as long as the next value is smaller than val (as an unsigned short) when iterating in reverse through the chars it will advance as long as the next value is larger than val (as an unsigned short)- Specified by:
advanceIfNeeded
in interfacePeekableCharIterator
- Parameters:
minval
- threshold
-
peekNextRank
public int peekNextRank()
Description copied from interface:PeekableCharRankIterator
peek in-container rank of the next value Uses integer because internal representation of rank is int and in-container rank lies in range 1-65536- Specified by:
peekNextRank
in interfacePeekableCharRankIterator
- Returns:
- rank of the next value
-
clone
public PeekableCharRankIterator clone()
Description copied from interface:PeekableCharIterator
Creates a copy of the iterator.- Specified by:
clone
in interfaceCharIterator
- Specified by:
clone
in interfacePeekableCharIterator
- Specified by:
clone
in interfacePeekableCharRankIterator
- Overrides:
clone
in classjava.lang.Object
- Returns:
- a clone of the current iterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceCharIterator
- Returns:
- whether there is another value
-
next
public char next()
- Specified by:
next
in interfaceCharIterator
- Returns:
- next char value
-
nextAsInt
public int nextAsInt()
- Specified by:
nextAsInt
in interfaceCharIterator
- Returns:
- next short value as int value (using the least significant 16 bits)
-
peekNext
public char peekNext()
Description copied from interface:PeekableCharIterator
Look at the next value without advancing- Specified by:
peekNext
in interfacePeekableCharIterator
- Returns:
- next value
-
remove
public void remove()
Description copied from interface:CharIterator
If possible, remove the current value- Specified by:
remove
in interfaceCharIterator
-
wrap
void wrap(ArrayContainer p)
-
-