Class TextFunction
java.lang.Object
org.apache.poi.ss.formula.functions.TextFunction
- All Implemented Interfaces:
Function
- Author:
- Amol S. Deshmukh < amolweb at ya hoo dot com >, Josh Micich, Stephen Wolke (smwolke at geistig.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 Function
static final Function
static final Function
Implementation of the FIND() function.protected static final DataFormatter
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal ValueEval
protected static double
evaluateDoubleArg
(ValueEval arg, int srcCellRow, int srcCellCol) protected abstract ValueEval
evaluateFunc
(ValueEval[] args, int srcCellRow, int srcCellCol) protected static int
evaluateIntArg
(ValueEval arg, int srcCellRow, int srcCellCol) protected static String
evaluateStringArg
(ValueEval eval, int srcRow, int srcCol)
-
Field Details
-
formatter
-
CHAR
Returns the character specified by a number. -
LEN
-
LOWER
-
UPPER
-
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
An implementation of the TRIM function: Removes leading and trailing spaces from value if evaluated operand value is string. Author: Manda Wilson < wilson at c bio dot msk cc dot org > -
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
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
-
RIGHT
-
CONCATENATE
-
EXACT
-
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 toDataFormatter
to be done, as this works much the same as the display focused work that that does. Syntax:
TEXT(value, format_text) -
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)
-
SEARCH
Implementation of the FIND() function.Syntax:
SEARCH(find_text, within_text, start_num)SEARCH is a case-insensitive version of FIND()
-
-
Constructor Details
-
TextFunction
public TextFunction()
-
-
Method Details
-
evaluateStringArg
protected static String evaluateStringArg(ValueEval eval, int srcRow, int srcCol) throws EvaluationException - Throws:
EvaluationException
-
evaluateIntArg
protected static int evaluateIntArg(ValueEval arg, int srcCellRow, int srcCellCol) throws EvaluationException - Throws:
EvaluationException
-
evaluateDoubleArg
protected static double evaluateDoubleArg(ValueEval arg, int srcCellRow, int srcCellCol) throws EvaluationException - Throws:
EvaluationException
-
evaluate
- Specified by:
evaluate
in interfaceFunction
- Parameters:
args
- the evaluated function arguments. Empty values are represented withBlankEval
orMissingArgEval
, nevernull
.srcCellRow
- row index of the cell containing the formula under evaluationsrcCellCol
- column index of the cell containing the formula under evaluation- Returns:
- The evaluated result, possibly an
ErrorEval
, nevernull
. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate toDouble.NaN
be sure to translate the result toErrorEval.NUM_ERROR
.
-
evaluateFunc
protected abstract ValueEval evaluateFunc(ValueEval[] args, int srcCellRow, int srcCellCol) throws EvaluationException - Throws:
EvaluationException
-