Class ArrayIterator<ELEMENTTYPE>
- java.lang.Object
-
- com.helger.commons.collection.iterate.ArrayIterator<ELEMENTTYPE>
-
- Type Parameters:
ELEMENTTYPE- Type of object to iterate.
- All Implemented Interfaces:
ICommonsIterable<ELEMENTTYPE>,IIterableIterator<ELEMENTTYPE>,Iterable<ELEMENTTYPE>,Iterator<ELEMENTTYPE>
public final class ArrayIterator<ELEMENTTYPE> extends Object implements IIterableIterator<ELEMENTTYPE>
This is a small helper class for iterating over arrays.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description ArrayIterator(ELEMENTTYPE... aArray)ArrayIterator(ELEMENTTYPE[] aArray, int nOfs, int nLength)Private constructor with offset and length
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()booleanhasNext()ELEMENTTYPEnext()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCount, getCount
-
Methods inherited from interface com.helger.commons.collection.iterate.IIterableIterator
iterator, withFilter, withMapper
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
ArrayIterator
@SafeVarargs public ArrayIterator(@Nonnull ELEMENTTYPE... aArray)
-
ArrayIterator
public ArrayIterator(@Nonnull ELEMENTTYPE[] aArray, @Nonnegative int nOfs, @Nonnegative int nLength)
Private constructor with offset and length- Parameters:
aArray- Source arraynOfs- Offset. Must be ≥ 0.nLength- Length. Must be ≥ 0.
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<ELEMENTTYPE>
-
next
@Nullable public ELEMENTTYPE next()
- Specified by:
nextin interfaceIterator<ELEMENTTYPE>
-
-