Package io.atlassian.fugue
Class Iterables.Memoizer.Lazy<A>
java.lang.Object
java.lang.ref.Reference<Iterables.Memoizer.Node<A>>
java.lang.ref.WeakReference<Iterables.Memoizer.Node<A>>
io.atlassian.fugue.Iterables.LazyReference<Iterables.Memoizer.Node<A>>
io.atlassian.fugue.Iterables.Memoizer.Lazy<A>
- All Implemented Interfaces:
Iterables.Memoizer.Node<A>,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 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.atlassian.fugue.Iterables.LazyReference
cancel, get, getInterruptibly, isInitializedMethods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
delegate
-
value
-
-
Constructor Details
-
Lazy
-
-
Method Details
-
create
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:
Exception- if anything goes wrong, rethrown as an InitializationException fromIterables.LazyReference.get()andIterables.LazyReference.getInterruptibly()
-
next
Description copied from interface:Iterables.Memoizer.NodeGet the next Node.- Specified by:
nextin interfaceIterables.Memoizer.Node<A>- Returns:
- a new Node
- Throws:
NoSuchElementException- if this is terminal
-
isEnd
public boolean isEnd()- Specified by:
isEndin interfaceIterables.Memoizer.Node<A>
-
value
- Specified by:
valuein interfaceIterables.Memoizer.Node<A>
-