Top Description Fields Constructors Methods
org.hsqldb.lib

public Class WrapperIterator<E>

extends Object
implements Iterator<E>
Class Inheritance
All Implemented Interfaces
org.hsqldb.lib.Iterator
Imports
java.util.NoSuchElementException

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

Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
HSQLDB 1.7.2
Version
2.7.3

Field Summary

Modifier and TypeField and Description
private boolean
private Object[]
private static final Object[]
private int
i

private Iterator<E>
private Iterator<E>
private boolean
notNull

return only not null elements

Constructor Summary

AccessConstructor and Description
public
WrapperIterator()

Constructor for an empty iterator.

public
WrapperIterator(Object[]
the array of objects to enumerate
elements
)

Constructor for all elements of the specified array.

public
WrapperIterator(Object[]
the array of objects to iterate
elements
,
boolean
boolean
notNull
)

Constructor for not-null elements of specified array.

public
WrapperIterator(Object
the single object to iterate
element
)

Constructor for a singleton object iterator

public
WrapperIterator(Iterator<E>
Iterator
it1
,
Iterator<E>
Iterator
it2
)

Constructor for a chained iterator that returns the elements of the two specified iterators.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this iterator contains more elements; false otherwise.
hasNext
()

Implements org.hsqldb.lib.Iterator.hasNext.

Tests if this iterator contains more elements.

public E

Returns:

the next element
next
()

Implements org.hsqldb.lib.Iterator.next.

Returns the next element.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chainedback to summary
private boolean chained
elementsback to summary
private Object[] elements
emptyelementsback to summary
private static final Object[] emptyelements
iback to summary
private int i
it1back to summary
private Iterator<E> it1
it2back to summary
private Iterator<E> it2
notNullback to summary
private boolean notNull

return only not null elements

Constructor Detail

WrapperIteratorback to summary
public WrapperIterator()

Constructor for an empty iterator.

WrapperIteratorback to summary
public WrapperIterator(Object[] elements)

Constructor for all elements of the specified array.

Parameters
elements:Object[]

the array of objects to enumerate

WrapperIteratorback to summary
public WrapperIterator(Object[] elements, boolean notNull)

Constructor for not-null elements of specified array.

Parameters
elements:Object[]

the array of objects to iterate

notNull:boolean

boolean

WrapperIteratorback to summary
public WrapperIterator(Object element)

Constructor for a singleton object iterator

Parameters
element:Object

the single object to iterate

WrapperIteratorback to summary
public WrapperIterator(Iterator<E> it1, Iterator<E> it2)

Constructor for a chained iterator that returns the elements of the two specified iterators.

Parameters
it1:Iterator<E>

Iterator

it2:Iterator<E>

Iterator

Method Detail

hasNextback to summary
public boolean hasNext()

Implements org.hsqldb.lib.Iterator.hasNext.

Tests if this iterator contains more elements.

Returns:boolean

true if this iterator contains more elements; false otherwise.

nextback to summary
public E next()

Implements org.hsqldb.lib.Iterator.next.

Returns the next element.

Returns:E

the next element

Exceptions
NoSuchElementException:
if there is no next element