net.sourceforge.jeval.function
Class FunctionHelper

java.lang.Object
  extended by net.sourceforge.jeval.function.FunctionHelper

public class FunctionHelper
extends java.lang.Object

This class contains many methods that are helpful when writing functions. Some of these methods were created to help with the creation of the math and string functions packaged with Evaluator.


Constructor Summary
FunctionHelper()
           
 
Method Summary
static java.util.ArrayList getDoubles(java.lang.String arguments, char delimiter)
          This methods takes a string of input function arguments, evaluates each argument and creates a Double value for each argument from the result of the evaluations.
static java.util.ArrayList getOneStringAndOneInteger(java.lang.String arguments, char delimiter)
          This methods takes a string of input function arguments, evaluates each argument and creates a one Integer and one String value for each argument from the result of the evaluations.
static java.util.ArrayList getOneStringAndTwoIntegers(java.lang.String arguments, char delimiter)
          This methods takes a string of input function arguments, evaluates each argument and creates a one String and two Integers value for each argument from the result of the evaluations.
static java.util.ArrayList getStrings(java.lang.String arguments, char delimiter)
          This methods takes a string of input function arguments, evaluates each argument and creates a String value for each argument from the result of the evaluations.
static java.util.ArrayList getTwoStringsAndOneInteger(java.lang.String arguments, char delimiter)
          This methods takes a string of input function arguments, evaluates each argument and creates a two Strings and one Integer value for each argument from the result of the evaluations.
static java.lang.String trimAndRemoveQuoteChars(java.lang.String arguments, char quoteCharacter)
          This method first removes any white space at the beginning and end of the input string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionHelper

public FunctionHelper()
Method Detail

trimAndRemoveQuoteChars

public static java.lang.String trimAndRemoveQuoteChars(java.lang.String arguments,
                                                       char quoteCharacter)
                                                throws FunctionException
This method first removes any white space at the beginning and end of the input string. It then removes the specified quote character from the the first and last characters of the string if a quote character exists in those positions. If quote characters are not in the first and last positions after the white space is trimmed, then a FunctionException will be thrown.

Parameters:
arguments - The arguments to trim and revove quote characters from.
quoteCharacter - The character to remove from the first and last position of the trimmed string.
Returns:
The arguments with white space and quote characters removed.
Throws:
FunctionException - Thrown if quote characters do not exist in the first and last positions after the white space is trimmed.

getDoubles

public static java.util.ArrayList getDoubles(java.lang.String arguments,
                                             char delimiter)
                                      throws FunctionException
This methods takes a string of input function arguments, evaluates each argument and creates a Double value for each argument from the result of the evaluations.

Parameters:
arguments - The arguments to parse.
delimiter - The delimiter to use while parsing.
Returns:
An array list of Double values found in the input string.
Throws:
FunctionException - Thrown if the string does not properly parse into Double values.

getStrings

public static java.util.ArrayList getStrings(java.lang.String arguments,
                                             char delimiter)
                                      throws FunctionException
This methods takes a string of input function arguments, evaluates each argument and creates a String value for each argument from the result of the evaluations.

Parameters:
arguments - The arguments of values to parse.
delimiter - The delimiter to use while parsing.
Returns:
An array list of String values found in the input string.
Throws:
FunctionException - Thrown if the stirng does not properly parse into String values.

getOneStringAndOneInteger

public static java.util.ArrayList getOneStringAndOneInteger(java.lang.String arguments,
                                                            char delimiter)
                                                     throws FunctionException
This methods takes a string of input function arguments, evaluates each argument and creates a one Integer and one String value for each argument from the result of the evaluations.

Parameters:
arguments - The arguments of values to parse.
delimiter - The delimiter to use while parsing.
Returns:
An array list of object values found in the input string.
Throws:
FunctionException - Thrown if the stirng does not properly parse into the proper objects.

getTwoStringsAndOneInteger

public static java.util.ArrayList getTwoStringsAndOneInteger(java.lang.String arguments,
                                                             char delimiter)
                                                      throws FunctionException
This methods takes a string of input function arguments, evaluates each argument and creates a two Strings and one Integer value for each argument from the result of the evaluations.

Parameters:
arguments - The arguments of values to parse.
delimiter - The delimiter to use while parsing.
Returns:
An array list of object values found in the input string.
Throws:
FunctionException - Thrown if the stirng does not properly parse into the proper objects.

getOneStringAndTwoIntegers

public static java.util.ArrayList getOneStringAndTwoIntegers(java.lang.String arguments,
                                                             char delimiter)
                                                      throws FunctionException
This methods takes a string of input function arguments, evaluates each argument and creates a one String and two Integers value for each argument from the result of the evaluations.

Parameters:
arguments - The arguments of values to parse.
delimiter - The delimiter to use while parsing.
Returns:
An array list of object values found in the input string.
Throws:
FunctionException - Thrown if the stirng does not properly parse into the proper objects.


Copyright (C) 2002-2007 Robert Breidecker.