Package org.wildfly.common.iteration
Interface BiDirIntIterator
- All Superinterfaces:
IntIterator
- All Known Implementing Classes:
ByteIterator,CodePointIterator
A bi-directional primitive iterator.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Determine if there is another element in this sequence.booleanDetermine if there is a previous element in this sequence.intnext()Get the next element in the sequence.intpeekNext()Observe the next element in the sequence without moving the iterator.intObserve the previous element in the sequence without moving the iterator.intprevious()Get the previous element in the sequence.
-
Method Details
-
hasNext
boolean hasNext()Description copied from interface:IntIteratorDetermine if there is another element in this sequence.- Specified by:
hasNextin interfaceIntIterator- Returns:
trueif there is another element,falseotherwise
-
next
Description copied from interface:IntIteratorGet the next element in the sequence.- Specified by:
nextin interfaceIntIterator- Returns:
- the next element
- Throws:
NoSuchElementException- if there are no more elements
-
peekNext
Description copied from interface:IntIteratorObserve the next element in the sequence without moving the iterator.- Specified by:
peekNextin interfaceIntIterator- Returns:
- the next element
- Throws:
NoSuchElementException- if there are no more elements
-
hasPrevious
boolean hasPrevious()Determine if there is a previous element in this sequence.- Returns:
trueif there is a previous element,falseotherwise
-
previous
Get the previous element in the sequence.- Returns:
- the previous element
- Throws:
NoSuchElementException- if there are no more elements
-
peekPrevious
Observe the previous element in the sequence without moving the iterator.- Returns:
- the previous element
- Throws:
NoSuchElementException- if there are no more elements
-