cascading.util

## Class SingleValueCloseableIterator<Value>

- java.lang.Object
- - cascading.util.SingleValueIterator<Value>
  - - cascading.util.SingleValueCloseableIterator<Value>

- Type Parameters:
    `Value` -
  All Implemented Interfaces:
    CloseableIterator<Value>, Closeable, AutoCloseable, Iterator<Value>
  Direct Known Subclasses:
    RecordReaderIterator, SingleCloseableInputIterator

      public abstract class SingleValueCloseableIterator<Value>
      extends SingleValueIterator<Value>
      implements CloseableIterator<Value>

  SingleValueIterator is a utility class used for quickly presenting a single value to a consumer expecting both a `Closeable` and an `Iterator` interface. After returning the Value value via `SingleValueIterator.next()`, `SingleValueIterator.hasNext()` will return `false`.

  This class is especially useful if you do not wish to create a `Collection` to hold a single value in which to create an Iterator.

- - ### Field Summary

    - ### Fields inherited from class cascading.util.SingleValueIterator

      `EMPTY, value`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingleValueCloseableIterator(Value value)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `close()`
    `protected Value` | `getCloseableInput()`

    - ### Methods inherited from class cascading.util.SingleValueIterator

      `hasNext, next, remove, reset`

    - ### 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`

- - ### Constructor Detail

    - #### SingleValueCloseableIterator

          public SingleValueCloseableIterator(Value value)

  - ### Method Detail

    - #### getCloseableInput

          protected Value getCloseableInput()

    - #### close

          public abstract void close()
                              throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.