org.jfree.formula.function.datetime

Class DateDifFunction

Implemented Interfaces:
Function, Serializable

public class DateDifFunction
extends java.lang.Object
implements Function

This function returns the number of years, months, or days between two date numbers.

The Format is a code from the following table, entered as text, that specifies the format you want:

formatReturns the number of
yYears
mMonths. If there is not a complete month between the dates, 0 will be returned.
dDays
mdDays, ignoring months and years
ymMonths, ignoring years
ydDays, ignoring years
Author:
Cedric Pronzato

Field Summary

static String
DAYS_CODE
static String
DAYS_IGNORING_MONTHS_YEARS
static String
DAYS_IGNORING_YEARS
static String
MONTHS_CODE
static String
MONTHS_IGNORING_YEARS
static String
YEARS_CODE

Constructor Summary

DateDifFunction()

Method Summary

TypeValuePair
evaluate(FormulaContext context, ParameterCallback parameters)
String
getCanonicalName()

Field Details

DAYS_CODE

public static final String DAYS_CODE

DAYS_IGNORING_MONTHS_YEARS

public static final String DAYS_IGNORING_MONTHS_YEARS

DAYS_IGNORING_YEARS

public static final String DAYS_IGNORING_YEARS

MONTHS_CODE

public static final String MONTHS_CODE

MONTHS_IGNORING_YEARS

public static final String MONTHS_IGNORING_YEARS

YEARS_CODE

public static final String YEARS_CODE

Constructor Details

DateDifFunction

public DateDifFunction()

Method Details

evaluate

public TypeValuePair evaluate(FormulaContext context,
                              ParameterCallback parameters)
            throws EvaluationException
Specified by:
evaluate in interface Function

getCanonicalName

public String getCanonicalName()
Specified by:
getCanonicalName in interface Function