Class ReverseArrayIterator<T>
- java.lang.Object
-
- com.saperion.common.lang.iterator.ReverseArrayIterator<T>
-
- Type Parameters:
T
- type of objects to iterate
- All Implemented Interfaces:
java.util.Iterator<T>
public final class ReverseArrayIterator<T> extends java.lang.Object implements java.util.Iterator<T>
An
Iterator
that iterates through all elements of an array - in reversed order i.e. starting with the last element.Iterator.remove()
is not supported.- Author:
- jsc
-
-
Constructor Summary
Constructors Constructor Description ReverseArrayIterator(T[] array)
Creates a newReverseArrayIterator
, that iterates through all elements of the specified array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
T
next()
void
remove()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ReverseArrayIterator
public ReverseArrayIterator(T[] array)
Creates a newReverseArrayIterator
, that iterates through all elements of the specified array. The specified array must not benull
.- Parameters:
array
- array to iterate through
-
-