Package io.atlassian.fugue
Class Iterables.Memoizer.Lazy<A>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.WeakReference<T>
-
- io.atlassian.fugue.Iterables.LazyReference<Iterables.Memoizer.Node<A>>
-
- io.atlassian.fugue.Iterables.Memoizer.Lazy<A>
-
- All Implemented Interfaces:
Iterables.Memoizer.Node<A>,java.util.function.Supplier<Iterables.Memoizer.Node<A>>
- Enclosing class:
- Iterables.Memoizer<A>
static class Iterables.Memoizer.Lazy<A> extends Iterables.LazyReference<Iterables.Memoizer.Node<A>> implements Iterables.Memoizer.Node<A>
Lazily computes the next node. Has a value so is not an end.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.atlassian.fugue.Iterables.LazyReference
Iterables.LazyReference.InitializationException, Iterables.LazyReference.State
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterables.Memoizer.Node<A>create()The object factory method, guaranteed to be called once and only once.booleanisEnd()Iterables.Memoizer.Node<A>next()Get the next Node.Avalue()-
Methods inherited from class io.atlassian.fugue.Iterables.LazyReference
cancel, get, getInterruptibly, isInitialized
-
-
-
-
Constructor Detail
-
Lazy
Lazy(java.util.Iterator<A> delegate)
-
-
Method Detail
-
create
protected Iterables.Memoizer.Node<A> create() throws java.lang.Exception
Description copied from class:Iterables.LazyReferenceThe object factory method, guaranteed to be called once and only once.- Specified by:
createin classIterables.LazyReference<Iterables.Memoizer.Node<A>>- Returns:
- the object that
Iterables.LazyReference.get()andIterables.LazyReference.getInterruptibly()will return. - Throws:
java.lang.Exception- if anything goes wrong, rethrown as an InitializationException fromIterables.LazyReference.get()andIterables.LazyReference.getInterruptibly()
-
next
public Iterables.Memoizer.Node<A> next() throws java.util.NoSuchElementException
Description copied from interface:Iterables.Memoizer.NodeGet the next Node.- Specified by:
nextin interfaceIterables.Memoizer.Node<A>- Returns:
- a new Node
- Throws:
java.util.NoSuchElementException- if this is terminal
-
isEnd
public boolean isEnd()
- Specified by:
isEndin interfaceIterables.Memoizer.Node<A>
-
value
public A value()
- Specified by:
valuein interfaceIterables.Memoizer.Node<A>
-
-