net.sf.jga.fn.string
Class StringFunctors

java.lang.Object
  extended by net.sf.jga.fn.string.StringFunctors

public final class StringFunctors
extends java.lang.Object

Static factory methods for the functors in the String package.

Copyright © 2006 David A. Hall

Author:
David A. Hall

Constructor Summary
StringFunctors()
           
 
Method Summary
static
<T> UnaryFunctor<T,java.lang.String>
defaultFormat()
          Returns a functor that presents its argument in String form using the argument's toString() method.
static
<T extends java.util.Date>
UnaryFunctor<T,java.lang.String>
formatValue(java.text.DateFormat format)
          Returns a functor that presents its argument in String form using the given format
static UnaryFunctor<java.lang.Object[],java.lang.String> formatValue(java.text.MessageFormat format)
          Returns a functor that presents its argument in String form using the given format
static
<T extends java.lang.Number>
UnaryFunctor<T,java.lang.String>
formatValue(java.text.NumberFormat format)
          Returns a functor that presents its argument in String form using the given format
static UnaryFunctor<java.lang.String,java.lang.Boolean> match(java.util.regex.Pattern pattern)
          Returns a functor that matches its String argument against the given pattern
static UnaryFunctor<java.lang.String,java.lang.Boolean> match(java.lang.String regex)
          Returns a functor that matches its String argument against the given regex
static
<R extends java.util.Date>
UnaryFunctor<java.lang.String,R>
parseFormat(java.lang.Class<R> dateClass, java.text.DateFormat format)
          Returns a functor that parses its argument using the given format and returns an object of the given class.
static
<R extends java.lang.Number>
UnaryFunctor<java.lang.String,R>
parseFormat(java.lang.Class<R> numClass, java.text.NumberFormat format)
          Returns a functor that parses its argument using the given format and returns an object of the given class.
static
<R> UnaryFunctor<java.lang.String,R>
parseFormat(java.text.Format format, UnaryFunctor<java.lang.Object,R> converter)
          Returns a functor that parses its argument using the given format and returns an object of the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringFunctors

public StringFunctors()
Method Detail

defaultFormat

public static <T> UnaryFunctor<T,java.lang.String> defaultFormat()
Returns a functor that presents its argument in String form using the argument's toString() method.


formatValue

public static UnaryFunctor<java.lang.Object[],java.lang.String> formatValue(java.text.MessageFormat format)
Returns a functor that presents its argument in String form using the given format


formatValue

public static <T extends java.util.Date> UnaryFunctor<T,java.lang.String> formatValue(java.text.DateFormat format)
Returns a functor that presents its argument in String form using the given format


formatValue

public static <T extends java.lang.Number> UnaryFunctor<T,java.lang.String> formatValue(java.text.NumberFormat format)
Returns a functor that presents its argument in String form using the given format


match

public static UnaryFunctor<java.lang.String,java.lang.Boolean> match(java.lang.String regex)
Returns a functor that matches its String argument against the given regex


match

public static UnaryFunctor<java.lang.String,java.lang.Boolean> match(java.util.regex.Pattern pattern)
Returns a functor that matches its String argument against the given pattern


parseFormat

public static <R> UnaryFunctor<java.lang.String,R> parseFormat(java.text.Format format,
                                                               UnaryFunctor<java.lang.Object,R> converter)
Returns a functor that parses its argument using the given format and returns an object of the given class.


parseFormat

public static <R extends java.util.Date> UnaryFunctor<java.lang.String,R> parseFormat(java.lang.Class<R> dateClass,
                                                                                      java.text.DateFormat format)
Returns a functor that parses its argument using the given format and returns an object of the given class.


parseFormat

public static <R extends java.lang.Number> UnaryFunctor<java.lang.String,R> parseFormat(java.lang.Class<R> numClass,
                                                                                        java.text.NumberFormat format)
Returns a functor that parses its argument using the given format and returns an object of the given class.



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