org.modeshape.jcr.cache.document

## Class UnionIterator<Type>

- java.lang.Object
- - org.modeshape.jcr.cache.document.UnionIterator<Type>

- Type Parameters:
    `Type` - the value type of the iterator
  All Implemented Interfaces:
    Iterator<Type>

      public class UnionIterator<Type>
      extends Object
      implements Iterator<Type>

  An iterator that presents the union of two iterators. The second iterator is retrieved only when needed.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnionIterator(Iterator<Type> firstIterator, Iterable<Type> next)` Create a union iterator

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `Type` | `next()`
    `void` | `remove()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UnionIterator

          public UnionIterator(Iterator<Type> firstIterator,
                       Iterable<Type> next)

      Create a union iterator
      Parameters:
        `firstIterator` - the first iterator; may not be null
        `next` - the Iterable from which the second iterator is to be obtained; may be null

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<Type>`

    - #### next

          public Type next()

      Specified by:
        `next` in interface `Iterator<Type>`

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `Iterator<Type>`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.