|
|||||||||
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<java.lang.String,R> net.sf.jga.fn.string.ParseFormat<R>
public class ParseFormat<R>
Unary Functor that parses a given Format.
Copyright © 2003-2005 David A. Hall
Nested Class Summary | |
---|---|
static class |
ParseFormat.Date<T extends java.util.Date>
ParseFormat functor for use with Dates. |
static class |
ParseFormat.Number<T extends java.lang.Number>
ParseFormat functor for use with Numbers. |
static interface |
ParseFormat.Visitor
Interface for classes that may interpret a ParseFormat predicate. |
Constructor Summary | |
---|---|
protected |
ParseFormat(java.text.Format format,
UnaryFunctor<java.lang.Object,R> conv)
Builds the ParseFormat given a text Format and a functor that can convert Objects returned by the Format's parse(Object) method and the desired type of this functor. |
Method Summary | |
---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(ParseFormat) method, if it
implements the nested Visitor interface. |
R |
fn(java.lang.String arg)
Parses the value from the given string, using the java.text.Format object passed at construction. |
java.text.Format |
getFormat()
|
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 |
---|
protected ParseFormat(java.text.Format format, UnaryFunctor<java.lang.Object,R> conv)
Method Detail |
---|
public java.text.Format getFormat()
public R fn(java.lang.String arg)
fn
in class UnaryFunctor<java.lang.String,R>
arg
- formatted string to be parsed
java.text.ParseException
- when the string cannot be parsed to the
correct typepublic void accept(Visitor v)
visit(ParseFormat)
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 |