java.lang.Object
org.hsqldb.lib.WrapperIterator<E>
- All Implemented Interfaces:
Iterator<E>
An Iterator that returns the elements of a specified array, or other
iterators etc. The collection of objects returned depends on the
constructor used.
Based on similar Enumerator code by campbell-burnet@users
- Since:
- HSQLDB 1.7.2
- Author:
- fred@users
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for an empty iterator.WrapperIterator
(Object element) Constructor for a singleton object iteratorWrapperIterator
(Object[] elements) Constructor for all elements of the specified array.WrapperIterator
(Object[] elements, boolean notNull) Constructor for not-null elements of specified array.WrapperIterator
(Iterator<E> it1, Iterator<E> it2) Constructor for a chained iterator that returns the elements of the two specified iterators. -
Method Summary
-
Constructor Details
-
WrapperIterator
public WrapperIterator()Constructor for an empty iterator. -
WrapperIterator
Constructor for all elements of the specified array.- Parameters:
elements
- the array of objects to enumerate
-
WrapperIterator
Constructor for not-null elements of specified array.- Parameters:
elements
- the array of objects to iteratenotNull
- boolean
-
WrapperIterator
Constructor for a singleton object iterator- Parameters:
element
- the single object to iterate
-
WrapperIterator
Constructor for a chained iterator that returns the elements of the two specified iterators.- Parameters:
it1
- Iteratorit2
- Iterator
-
-
Method Details
-
hasNext
public boolean hasNext()Tests if this iterator contains more elements. -
next
Returns the next element.- Specified by:
next
in interfaceIterator<E>
- Returns:
- the next element
- Throws:
NoSuchElementException
- if there is no next element
-
nextInt
public int nextInt() -
nextLong
public long nextLong() -
remove
public void remove()
-