org.javimmutable.collections.cursors
Class SingleValueCursor<T>
java.lang.Object
org.javimmutable.collections.cursors.AbstractStartCursor<T>
org.javimmutable.collections.cursors.SingleValueCursor<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- Iterable<T>, Cursor<T>
@Immutable
public class SingleValueCursor<T>
- extends AbstractStartCursor<T>
A Cursor containing exactly one value to be traversed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
of
@Nonnull
public static <V> SingleValueCursor<V> of(V value)
next
@Nonnull
public Cursor<T> next()
- Description copied from interface:
Cursor
- Advances to the next (possibly first) value. Must always return a non-null Cursor.
A newly created Cursor must always point to "before" the first value because next() (or start()) must
always be called once before retrieving the first value. If the Cursor is already at the end
of its sequence then it should return a Cursor that will always return false for hasValue().
- Specified by:
next
in interface Cursor<T>
- Overrides:
next
in class AbstractStartCursor<T>
- Returns:
- Cursor for next position
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
- Overrides:
iterator
in class AbstractStartCursor<T>
Copyright © 2014 Burton Computer Corporation. All rights reserved.