Top Description Fields Constructors Methods
org.apache.poi.ss.formula.functions

public final Class TimeFunc

extends Fixed3ArgFunction
Class Inheritance
Imports
org.apache.poi.ss.formula.eval.ErrorEval, .EvaluationException, .MissingArgEval, .NumberEval, .OperandResolver, .ValueEval

Implementation for the Excel function TIME

Based on POI DateFunc

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
evalArg(ValueEval arg, int srcRowIndex, int srcColumnIndex)

public ValueEval
private static double

Returns:

An Excel representation of a time of day. If the time value represents more than a day, the days are removed from the result, leaving only the time of day component.
evaluate
(int hours, int minutes, int
as an integer
seconds
)

Converts the supplied hours, minutes and seconds to an Excel time value.

Inherited from org.apache.poi.ss.formula.functions.Fixed3ArgFunction:
evaluate

Field Detail

HOURS_PER_DAYback to summary
private static final int HOURS_PER_DAY
SECONDS_PER_DAYback to summary
private static final int SECONDS_PER_DAY
SECONDS_PER_HOURback to summary
private static final int SECONDS_PER_HOUR
SECONDS_PER_MINUTEback to summary
private static final int SECONDS_PER_MINUTE

Constructor Detail

TimeFuncback to summary
public TimeFunc()

Method Detail

evalArgback to summary
private static int evalArg(ValueEval arg, int srcRowIndex, int srcColumnIndex) throws EvaluationException
evaluateback to summary
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2)

Implements org.apache.poi.ss.formula.functions.Function3Arg.evaluate.

Doc from org.apache.poi.ss.formula.functions.Function3Arg.evaluate.

see Function#evaluate(ValueEval[], int, int)

evaluateback to summary
private static double evaluate(int hours, int minutes, int seconds) throws EvaluationException

Converts the supplied hours, minutes and seconds to an Excel time value.

Parameters
seconds:int

as an integer

Returns:double

An Excel representation of a time of day. If the time value represents more than a day, the days are removed from the result, leaving only the time of day component.

Exceptions
EvaluationException:
If any of the arguments are greater than 32767 or the hours minutes and seconds when combined form a time value less than 0, the function evaluates to an error.