org.apache.poi.hssf.record.formula.functions
Class Trim

java.lang.Object
  extended by org.apache.poi.hssf.record.formula.functions.TextFunction
      extended by org.apache.poi.hssf.record.formula.functions.Trim
All Implemented Interfaces:
Function

public class Trim
extends TextFunction

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 >

Field Summary
 
Fields inherited from class org.apache.poi.hssf.record.formula.functions.TextFunction
EMPTY_STRING
 
Constructor Summary
Trim()
           
 
Method Summary
 Eval evaluate(Eval[] operands, int srcCellRow, short srcCellCol)
          Removes leading and trailing spaces from value if evaluated operand value is string.
 
Methods inherited from class org.apache.poi.hssf.record.formula.functions.TextFunction
attemptXlateToText, singleOperandEvaluate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trim

public Trim()
Method Detail

evaluate

public Eval evaluate(Eval[] operands,
                     int srcCellRow,
                     short srcCellCol)
Removes leading and trailing spaces from value if evaluated operand value is string. Returns StringEval only if evaluated operand is of type string (and is not blank or null) or number. If evaluated operand is of type string and is blank or null, or if evaluated operand is of type blank, returns BlankEval. Otherwise returns ErrorEval.

See Also:
Eval


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.