net.sf.jga.fn.string

Class FormatValue<T>

public class FormatValue<T> extends AbstractUnaryFunctor<T,String> implements Serializable

Unary Functor that generates a formatted string for a given value.

Copyright © 2003 David A. Hall

Author: David A. Hall

Nested Class Summary
interfaceFormatValue.Visitor
Interface for classes that may interpret a FormatValue predicate.
Constructor Summary
FormatValue(Format format)
Method Summary
voidaccept(Visitor v)
Calls the Visitor's visit(FormatValue) method, if it implements the nested Visitor interface.
Stringfn(T arg)
Formats the argument using the java.text.Format given at construction

FormatgetFormat()
Returns the format object used to present values in formatted form.
StringtoString()

Constructor Detail

FormatValue

public FormatValue(Format format)

Method Detail

accept

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

fn

public String fn(T arg)
Formats the argument using the java.text.Format given at construction

Parameters: arg the value to formatted

Returns: the formatted value

getFormat

public Format getFormat()
Returns the format object used to present values in formatted form.

Returns: the format used to present values

toString

public String toString()