Package org.wildfly.common.iteration
Interface BiDirIntIterator
-
- All Superinterfaces:
IntIterator
- All Known Implementing Classes:
ByteIterator
,CodePointIterator
public interface BiDirIntIterator extends IntIterator
A bi-directional primitive iterator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasNext()
Determine if there is another element in this sequence.boolean
hasPrevious()
Determine if there is a previous element in this sequence.int
next()
Get the next element in the sequence.int
peekNext()
Observe the next element in the sequence without moving the iterator.int
peekPrevious()
Observe the previous element in the sequence without moving the iterator.int
previous()
Get the previous element in the sequence.
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Description copied from interface:IntIterator
Determine if there is another element in this sequence.- Specified by:
hasNext
in interfaceIntIterator
- Returns:
true
if there is another element,false
otherwise
-
next
int next() throws java.util.NoSuchElementException
Description copied from interface:IntIterator
Get the next element in the sequence.- Specified by:
next
in interfaceIntIterator
- Returns:
- the next element
- Throws:
java.util.NoSuchElementException
- if there are no more elements
-
peekNext
int peekNext() throws java.util.NoSuchElementException
Description copied from interface:IntIterator
Observe the next element in the sequence without moving the iterator.- Specified by:
peekNext
in interfaceIntIterator
- Returns:
- the next element
- Throws:
java.util.NoSuchElementException
- if there are no more elements
-
hasPrevious
boolean hasPrevious()
Determine if there is a previous element in this sequence.- Returns:
true
if there is a previous element,false
otherwise
-
previous
int previous() throws java.util.NoSuchElementException
Get the previous element in the sequence.- Returns:
- the previous element
- Throws:
java.util.NoSuchElementException
- if there are no more elements
-
peekPrevious
int peekPrevious() throws java.util.NoSuchElementException
Observe the previous element in the sequence without moving the iterator.- Returns:
- the previous element
- Throws:
java.util.NoSuchElementException
- if there are no more elements
-
-