public class XBooleanArrayIterator extends Object implements XBooleanIterator
XBooleanIterator
that wraps a boolean array.Constructor and Description |
---|
XBooleanArrayIterator(boolean[] array)
Constructs a new array iterator.
|
XBooleanArrayIterator(boolean[] array,
int offset,
int length)
Constructs a new array iterator.
|
Modifier and Type | Method and Description |
---|---|
boolean[] |
array()
The array backing this iterator.
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
int |
length()
Gets the length of the iterator (the number of elements it returns
starting with the offset).
|
boolean |
next()
Returns the next element in the iteration.
|
int |
offset()
Gets the offset into the backing array at which this
iterator starts.
|
void |
remove()
Remove is not supported for array iterators.
|
XBooleanIterator |
toFirst()
Resets the iterator to the beginning.
|
public XBooleanArrayIterator(boolean[] array)
array
- The array to iterate.public XBooleanArrayIterator(boolean[] array, int offset, int length)
array
- The backing array.offset
- The offset into the array.length
- The length the number of elements including the offset to iterate.public final boolean[] array()
public final int offset()
public final int length()
public final boolean hasNext()
XBooleanIterator
hasNext
in interface XBooleanIterator
public final boolean next()
XBooleanIterator
next
in interface XBooleanIterator
public final void remove()
remove
in interface XBooleanIterator
UnsupportedOperationException
- If called.public final XBooleanIterator toFirst()
XBooleanIterator
toFirst
in interface XBooleanIterator
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.