Class TextFunction

java.lang.Object
org.apache.poi.ss.formula.functions.TextFunction
All Implemented Interfaces:
Function

public abstract class TextFunction extends Object implements Function
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Function
    Returns the character specified by a number.
    static final Function
    An implementation of the CLEAN function: In Excel, the Clean function removes all non-printable characters from a string.
    static final FreeRefFunction
     
    static final Function
     
    static final Function
     
    static final Function
    Implementation of the FIND() function.
    static final Function
     
    static final Function
     
    static final Function
     
    static final Function
    An implementation of the MID function
    MID returns a specific number of characters from a text string, starting at the specified position.
    static final Function
    Implementation of the PROPER function: Normalizes all words (separated by non-word characters) by making the first letter upper and the rest lower case.
    static final Function
     
    static final Function
    Implementation of the FIND() function.
    static final Function
    An implementation of the TEXT function
    TEXT returns a number value formatted with the given number formatting string.
    static final Function
    An implementation of the TRIM function: Removes leading and trailing spaces from value if evaluated operand value is string.
    static final Function
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final ValueEval
    evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CHAR

      public static final Function CHAR
      Returns the character specified by a number.
    • LEN

      public static final Function LEN
    • LOWER

      public static final Function LOWER
    • UPPER

      public static final Function UPPER
    • PROPER

      public static final Function PROPER
      Implementation of the PROPER function: Normalizes all words (separated by non-word characters) by making the first letter upper and the rest lower case. This is nearly equivalent to toTitleCase if the Java language had it
    • TRIM

      public static final Function TRIM
      An implementation of the TRIM function: Removes leading and trailing spaces from value if evaluated operand value is string. Since POI 5.1.0, this also trims double spaces so that only 1 is kept (https://bz.apache.org/bugzilla/show_bug.cgi?id=65230). Author: Manda Wilson < wilson at c bio dot msk cc dot org >
    • CLEAN

      public static final Function CLEAN
      An implementation of the CLEAN function: In Excel, the Clean function removes all non-printable characters from a string. Author: Aniket Banerjee(banerjee@google.com)
    • MID

      public static final Function MID
      An implementation of the MID function
      MID returns a specific number of characters from a text string, starting at the specified position.

      Syntax:
      MID(text, start_num, num_chars)
      Author: Manda Wilson < wilson at c bio dot msk cc dot org >

    • LEFT

      public static final Function LEFT
    • CONCAT

      public static final FreeRefFunction CONCAT
    • CONCATENATE

      public static final Function CONCATENATE
    • EXACT

      public static final Function EXACT
    • TEXT

      public static final Function TEXT
      An implementation of the TEXT function
      TEXT returns a number value formatted with the given number formatting string. This function is not a complete implementation of the Excel function, but handles most of the common cases. All work is passed down to DataFormatter to be done, as this works much the same as the display focused work that that does. Syntax:
      TEXT(value, format_text)
    • FIND

      public static final Function FIND
      Implementation of the FIND() function.

      Syntax:
      FIND(find_text, within_text, start_num)

      FIND returns the character position of the first (case sensitive) occurrence of find_text inside within_text. The third parameter, start_num, is optional (default=1) and specifies where to start searching from. Character positions are 1-based.

      Author: Torstein Tauno Svendsen (torstei@officenet.no)

  • Constructor Details

    • TextFunction

      public TextFunction()
  • Method Details

    • evaluate

      public final ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
      Specified by:
      evaluate in interface Function
      Parameters:
      args - the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval, never null.
      srcCellRow - row index of the cell containing the formula under evaluation
      srcCellCol - column index of the cell containing the formula under evaluation
      Returns:
      The evaluated result, possibly an ErrorEval, never null. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate to Double.NaN be sure to translate the result to ErrorEval.NUM_ERROR.