Class BuiltInString

  • All Implemented Interfaces:
    java.io.Serializable

    public class BuiltInString
    extends Function
    Built-in function for uppercase, substring and trimblanks.
    Version:
    $Revision 1.0 $
    Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com
    See Also:
    Serialized Form
    • Method Detail

      • getOutputDef

        public Attribute getOutputDef()
        Get the structure of the result produced by this function. Subclasses must implement.
        Specified by:
        getOutputDef in class Function
        Returns:
        the structure of the result produced by this function.
      • getParameterNames

        public java.lang.String[] getParameterNames()
        Returns an array of the names of the parameters expected as input by this function. May return null if the function can accept an unbounded number of arguments.
        Specified by:
        getParameterNames in class Function
        Returns:
        an array of the parameter names (or null if the function can accept any number of arguments).
      • getResult

        public double getResult​(double[] incoming)
                         throws java.lang.Exception
        Get the result of applying this function.
        Specified by:
        getResult in class Function
        Parameters:
        incoming - the arguments to this function (supplied in order to match that of the parameter definitions
        Returns:
        the result of applying this function. When the optype is categorical or ordinal, an index into the values of the output definition is returned.
        Throws:
        java.lang.Exception - if there is a problem computing the result of this function
      • setParameterDefs

        public void setParameterDefs​(java.util.ArrayList<Attribute> paramDefs)
                              throws java.lang.Exception
        Set the structure of the parameters that are expected as input by this function. This must be called before getOutputDef() is called.
        Specified by:
        setParameterDefs in class Function
        Parameters:
        paramDefs - the structure of the input parameters
        Throws:
        java.lang.Exception - if the number or types of parameters are not acceptable by this function
      • toString

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