Documentation of 'org.hsqldb.lib.WrapperIterator' Java class
WrapperIterator
org.hsqldb.lib

Class WrapperIterator

  • All Implemented Interfaces:
    Iterator


    public class WrapperIterator
    extends java.lang.Object
    implements Iterator
    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 boucherb@users

    Since:
    HSQLDB 1.7.2
    • Constructor Summary

      Constructors 
      Constructor and Description
      WrapperIterator()
      Constructor for an empty iterator.
      WrapperIterator(Iterator it1, Iterator it2)
      Constructor for a chained iterator that returns the elements of the two specified iterators.
      WrapperIterator(java.lang.Object element)
      Constructor for a singleton object iterator
      WrapperIterator(java.lang.Object[] elements)
      Constructor for all elements of the specified array.
      WrapperIterator(java.lang.Object[] elements, boolean notNull)
      Constructor for not-null elements of specified array.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean hasNext()
      Tests if this iterator contains more elements.
      java.lang.Object next()
      Returns the next element.
      int nextInt() 
      long nextLong() 
      void remove() 
      void setValue(java.lang.Object value) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WrapperIterator

        public WrapperIterator()
        Constructor for an empty iterator.

      • WrapperIterator

        public WrapperIterator(java.lang.Object[] elements)
        Constructor for all elements of the specified array.

        Parameters:
        elements - the array of objects to enumerate
      • WrapperIterator

        public WrapperIterator(java.lang.Object[] elements,
                               boolean notNull)
        Constructor for not-null elements of specified array.

        Parameters:
        elements - the array of objects to iterate
      • WrapperIterator

        public WrapperIterator(java.lang.Object element)
        Constructor for a singleton object iterator
        Parameters:
        element - the single object to iterate
      • WrapperIterator

        public WrapperIterator(Iterator it1,
                               Iterator it2)
        Constructor for a chained iterator that returns the elements of the two specified iterators.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Tests if this iterator contains more elements.

        Specified by:
        hasNext in interface Iterator
        Returns:
        true if this iterator contains more elements; false otherwise.
      • next

        public java.lang.Object next()
        Returns the next element.
        Specified by:
        next in interface Iterator
        Returns:
        the next element
        Throws:
        java.util.NoSuchElementException - if there is no next element
      • nextInt

        public int nextInt()
        Specified by:
        nextInt in interface Iterator
      • nextLong

        public long nextLong()
        Specified by:
        nextLong in interface Iterator
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator
      • setValue

        public void setValue(java.lang.Object value)
        Specified by:
        setValue in interface Iterator

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.