net.sf.jga.fn.adaptor
Class Identity.Accessor<T>
java.lang.Object
net.sf.jga.fn.Functor<R>
net.sf.jga.fn.Generator<T>
net.sf.jga.fn.adaptor.Identity.Accessor<T>
- All Implemented Interfaces:
- java.io.Serializable, Visitable
- Enclosing class:
- Identity<T>
public static class Identity.Accessor<T>
- extends Generator<T>
A Generator that returns the last value passed to an associated Identity. This allows an
Identity to serve as a cache for common subexpressions: if you compose the subexpression
within an Identity in it's first appearance in a compound functor, you can use the
Identity's Accessor as a replacement for all other appearances of the same subexpression.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
getIdentity
public Identity<T> getIdentity()
fn
public T fn()
- Description copied from class:
Generator
- Generate one instance.
- Specified by:
fn
in class Generator<T>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
accept
public void accept(Visitor v)
- Calls the Visitor's
visit(Constant)
method, if it
implements the nested Visitor interface.
- Specified by:
accept
in interface Visitable
- Overrides:
accept
in class Functor<T>
Copyright © 2002-2006 David A. Hall. All Rights Reserved.