MergeIterator (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.utils

## Class MergeIterator<In,Out>

- java.lang.Object
- - com.google.common.collect.UnmodifiableIterator<T>
  - - com.google.common.collect.AbstractIterator<Out>
    - - org.apache.cassandra.utils.MergeIterator<In,Out>

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<Out>, CloseableIterator<Out>, IMergeIterator<In,Out>

      public abstract class MergeIterator<In,Out>
      extends com.google.common.collect.AbstractIterator<Out>
      implements IMergeIterator<In,Out>

  Merges sorted input iterators which individually contain unique items.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `MergeIterator.Candidate<In>`
    `static class` | `MergeIterator.Reducer<In,Out>` Accumulator that collects values of type A, and outputs a value of type B.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.List<? extends java.util.Iterator<In>>` | `iterators`
    `protected MergeIterator.Reducer<In,Out>` | `reducer`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MergeIterator(java.util.List<? extends java.util.Iterator<In>> iters, MergeIterator.Reducer<In,Out> reducer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `static <In,Out> IMergeIterator<In,Out>` | `get(java.util.List<? extends java.util.Iterator<In>> sources, java.util.Comparator<In> comparator, MergeIterator.Reducer<In,Out> reducer)`
    `java.lang.Iterable<? extends java.util.Iterator<In>>` | `iterators()`

    - ### Methods inherited from class com.google.common.collect.AbstractIterator

      `computeNext, endOfData, hasNext, next, peek`

    - ### Methods inherited from class com.google.common.collect.UnmodifiableIterator

      `remove`

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

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

    - ### Methods inherited from interface java.util.Iterator

      `hasNext, next, remove`

- - ### Field Detail

    - #### reducer

          protected final MergeIterator.Reducer<In,Out> reducer

    - #### iterators

          protected final java.util.List<? extends java.util.Iterator<In>> iterators

  - ### Constructor Detail

    - #### MergeIterator

          protected MergeIterator(java.util.List<? extends java.util.Iterator<In>> iters,
                       MergeIterator.Reducer<In,Out> reducer)

  - ### Method Detail

    - #### get

          public static <In,Out> IMergeIterator<In,Out> get(java.util.List<? extends java.util.Iterator<In>> sources,
                                            java.util.Comparator<In> comparator,
                                            MergeIterator.Reducer<In,Out> reducer)

    - #### iterators

          public java.lang.Iterable<? extends java.util.Iterator<In>> iterators()

      Specified by:
        `iterators` in interface `IMergeIterator<In,Out>`

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

Copyright © 2014 The Apache Software Foundation