org.apache.ignite.internal.util.lang

## Class IgniteSingletonIterator<T>

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridIteratorAdapter<T>
  - - org.apache.ignite.internal.util.GridCloseableIteratorAdapter<T>
    - - org.apache.ignite.internal.util.lang.IgniteSingletonIterator<T>

All Implemented Interfaces:
  Serializable, AutoCloseable, Iterable<T>, Iterator<T>, GridSerializableIterator<T>, GridCloseableIterator<T>, GridIterator<T>, IgniteSpiCloseableIterator<T>

    public class IgniteSingletonIterator<T>
    extends GridCloseableIteratorAdapter<T>

Trivial iterator to return single item.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`IgniteSingletonIterator(T val)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `onHasNext()`
`protected T` `onNext()`

### Methods inherited from class org.apache.ignite.internal.util.GridCloseableIteratorAdapter

`checkClosed, close, hasNextX, isClosed, nextX, onClose, onRemove, removeX`

### Methods inherited from class org.apache.ignite.internal.util.lang.GridIteratorAdapter

`hasNext, iterator, next, remove`

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, iterator, spliterator`

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

`forEachRemaining, hasNext, next, remove`

### Constructor Detail

#### IgniteSingletonIterator

    public IgniteSingletonIterator(T val)

### Method Detail

#### onHasNext

    protected boolean onHasNext()
                         throws IgniteCheckedException

Specified by:
  `onHasNext` in class `GridCloseableIteratorAdapter<T>`
Returns:
  `True` if iterator has next element.
Throws:
  `IgniteCheckedException` - If failed.

#### onNext

    protected T onNext()
                throws IgniteCheckedException

Specified by:
  `onNext` in class `GridCloseableIteratorAdapter<T>`
Returns:
  Next element.
Throws:
  `IgniteCheckedException` - If failed.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.0
Release Date | : November 30 2018