org.apache.poi.hssf.record.formula.functions
Class TextFunction
java.lang.Object
org.apache.poi.hssf.record.formula.functions.TextFunction
- All Implemented Interfaces:
- Function
- Direct Known Subclasses:
- Find, Replace, Substitute
public abstract class TextFunction
- extends java.lang.Object
- implements Function
- Author:
- Amol S. Deshmukh < amolweb at ya hoo dot com >
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY_STRING
protected static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
LEN
public static final Function LEN
LOWER
public static final Function LOWER
UPPER
public static final Function UPPER
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.
Author: Manda Wilson < wilson at c bio dot msk cc dot org >
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
RIGHT
public static final Function RIGHT
CONCATENATE
public static final Function CONCATENATE
EXACT
public static final Function EXACT
TextFunction
public TextFunction()
evaluateStringArg
protected static final java.lang.String evaluateStringArg(ValueEval eval,
int srcRow,
short srcCol)
throws EvaluationException
- Throws:
EvaluationException
evaluateIntArg
protected static final int evaluateIntArg(ValueEval arg,
int srcCellRow,
short srcCellCol)
throws EvaluationException
- Throws:
EvaluationException
evaluate
public final ValueEval evaluate(ValueEval[] args,
int srcCellRow,
short 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 evaluationsrcCellCol
- 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
.
evaluateFunc
protected abstract ValueEval evaluateFunc(ValueEval[] args,
int srcCellRow,
short srcCellCol)
throws EvaluationException
- Throws:
EvaluationException
Copyright 2009 The Apache Software Foundation or
its licensors, as applicable.