|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.fn.Functor<R> net.sf.jga.fn.UnaryFunctor<T,R> net.sf.jga.fn.property.GetProperty<T,R>
public class GetProperty<T,R>
Unary Functor that returns the value of the named property for the argument. The property name and type are set at construction.
Copyright © 2002-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
GetProperty.Visitor
Interface for classes that may interpret a GetProperty function. |
Constructor Summary | |
---|---|
GetProperty(java.lang.Class<T> argclass,
java.lang.String propName)
Builds a GetProperty for the given property, using the given class to find the desired method. |
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(GetProperty) method, if it
implements the nested Visitor interface. |
R |
fn(T arg)
Returns the value of the designated property of the argument |
java.lang.String |
getPropertyName()
Returns the name of the property that this functor retrieves. |
java.lang.String |
toString()
|
Methods inherited from class net.sf.jga.fn.UnaryFunctor |
---|
bind, bind0th, bindNth, compose, compose, compose, composeNth, composeNth, eval, generate, generateNth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GetProperty(java.lang.Class<T> argclass, java.lang.String propName)
java.lang.IllegalArgumentException
- if the property name is null or empty,
or if there is no getter method for the given property name.Method Detail |
---|
public java.lang.String getPropertyName()
public R fn(T arg)
fn
in class UnaryFunctor<T,R>
EvaluationException
- if the argument does not have the designated
public property, or if it is not of the correct type.public void accept(Visitor v)
visit(GetProperty)
method, if it
implements the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<R>
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |