|
|||||||||
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.arithmetic.ValueOf<T,R>
public class ValueOf<T extends java.lang.Number,R extends java.lang.Number>
Returns the value of its numeric argument, converted to the approprate class.
Copyright © 2004-2005 David A. Hall
Nested Class Summary | |
---|---|
static interface |
ValueOf.Visitor
Interface for classes that may interpret a ValueOf functor. |
Constructor Summary | |
---|---|
ValueOf(java.lang.Class<R> c)
Builds ValueOf functor for the given class. |
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(ValueOf) method, if it implements
the nested Visitor interface. |
R |
fn(T x)
Given numeric argument x, converts x to the type passed at construction |
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 ValueOf(java.lang.Class<R> c)
java.lang.IllegalArgumentException
- if the given class has no Arithmetic
implementation registered with the ArithmeticFactoryMethod Detail |
---|
public R fn(T x)
fn
in class UnaryFunctor<T extends java.lang.Number,R extends java.lang.Number>
public void accept(Visitor v)
visit(ValueOf)
method, if it implements
the nested Visitor interface.
accept
in interface Visitable
accept
in class Functor<R extends java.lang.Number>
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 |