|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javimmutable.collections.cursors.TransformCursor<S,T>
@Immutable public class TransformCursor<S,T>
A Cursor that visits all values in another Cursor and transforms each value using a Func1 object.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.javimmutable.collections.Cursor |
---|
Cursor.NotStartedException, Cursor.NoValueException |
Constructor Summary | |
---|---|
TransformCursor(Cursor<S> source,
Func1<S,T> transforminator)
|
Method Summary | ||
---|---|---|
T |
getValue()
Return the value at the Cursor's position. |
|
boolean |
hasValue()
Read-only method with no side effects that determines if the Cursor currently has a value. |
|
Iterator<T> |
iterator()
|
|
Cursor<T> |
next()
Advances to the next (possibly first) value. |
|
static
|
of(Cursor<S> cursor,
Func1<S,T> transforminator)
|
|
static
|
ofKeys(Cursor<JImmutableMap.Entry<K,V>> cursor)
|
|
static
|
ofValues(Cursor<JImmutableMap.Entry<K,V>> cursor)
|
|
Cursor<T> |
start()
All Cursors are created in a pre-start position pointing "before" the first element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransformCursor(Cursor<S> source, Func1<S,T> transforminator)
Method Detail |
---|
public static <S,T> Cursor<T> of(Cursor<S> cursor, Func1<S,T> transforminator)
public static <K,V> Cursor<K> ofKeys(Cursor<JImmutableMap.Entry<K,V>> cursor)
public static <K,V> Cursor<V> ofValues(Cursor<JImmutableMap.Entry<K,V>> cursor)
@Nonnull public Cursor<T> start()
Cursor
start
in interface Cursor<T>
@Nonnull public Cursor<T> next()
Cursor
next
in interface Cursor<T>
public boolean hasValue()
Cursor
hasValue
in interface Cursor<T>
public T getValue()
Cursor
getValue
in interface Cursor<T>
public Iterator<T> iterator()
iterator
in interface Iterable<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |