net.sf.jga.fn.string
Class DefaultFormat<T>

java.lang.Object
  extended by net.sf.jga.fn.Functor<R>
      extended by net.sf.jga.fn.UnaryFunctor<T,java.lang.String>
          extended by net.sf.jga.fn.string.DefaultFormat<T>
All Implemented Interfaces:
java.io.Serializable, Visitable

public class DefaultFormat<T>
extends UnaryFunctor<T,java.lang.String>

Unary Functor that converts values to strings using the toString method.

Copyright © 2003-2005 David A. Hall

Author:
David A. Hall
See Also:
Serialized Form

Nested Class Summary
static interface DefaultFormat.Visitor
          Interface for classes that may interpret a DefaultFormat predicate.
 
Constructor Summary
DefaultFormat()
           
 
Method Summary
 void accept(Visitor v)
          Calls the Visitor's visit(DefaultFormat) method, if it implements the nested Visitor interface.
 java.lang.String fn(T arg)
          Invokes toString() on the argument
 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

DefaultFormat

public DefaultFormat()
Method Detail

fn

public java.lang.String fn(T arg)
Invokes toString() on the argument

Specified by:
fn in class UnaryFunctor<T,java.lang.String>
Parameters:
arg - the value to formatted
Returns:
the formatted value

accept

public void accept(Visitor v)
Calls the Visitor's visit(DefaultFormat) method, if it implements the nested Visitor interface.

Specified by:
accept in interface Visitable
Overrides:
accept in class Functor<java.lang.String>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2006 David A. Hall. All Rights Reserved.