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

public Class Days

extends Object
implements FreeRefFunction
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.formula.functions.FreeRefFunction
Imports
java.time.LocalDate, java.time.temporal.ChronoUnit, java.util.Date, org.apache.poi.ss.formula.OperationEvaluationContext, org.apache.poi.ss.formula.eval.ErrorEval, .EvaluationException, .NumberEval, .OperandResolver, .ValueEval, org.apache.poi.ss.usermodel.DateUtil, org.apache.poi.ss.util.DateParser, org.apache.poi.util.LocaleUtil

Calculates the number of days between two dates based on a real year, which is used in some accounting calculations.

DAYS(end_date,start_date)

See Also
DAYS function - Microsoft Office

Field Summary

Modifier and TypeField and Description
public static final Days

Constructor Summary

AccessConstructor and Description
private
Days()

Method Summary

Modifier and TypeMethod and Description
public ValueEval
evaluate(ValueEval[]
the pre-evaluated arguments for this function. args is never null, nor are any of its elements.
args
,
OperationEvaluationContext
primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.
ec
)

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

private ValueEval
evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)

private static double
evaluate(LocalDate endDate, LocalDate startDate)

pack-priv static LocalDate
getDate(ValueEval eval, int srcRowIndex, int srcColumnIndex)

private static LocalDate
getDate(double date)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
public static final Days instance

Constructor Detail

Daysback to summary
private Days()

Method Detail

evaluateback to summary
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)

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

Parameters
args:ValueEval[]

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

the pre-evaluated arguments for this function. args is never null, nor are any of its elements.

ec:OperationEvaluationContext

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

primarily used to identify the source cell containing the formula being evaluated. may also be used to dynamically create reference evals.

Returns:ValueEval

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

never null. Possibly an instance of ErrorEval in the case of a specified Excel error (Exceptions are never thrown to represent Excel errors).

Annotations
@Override
evaluateback to summary
private ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1)
evaluateback to summary
private static double evaluate(LocalDate endDate, LocalDate startDate)
getDateback to summary
pack-priv static LocalDate getDate(ValueEval eval, int srcRowIndex, int srcColumnIndex) throws EvaluationException
getDateback to summary
private static LocalDate getDate(double date)