Formula 1.0.0

hirondelle.formula.function.builtin
Class DaysMinus

Object
  extended by hirondelle.formula.function.builtin.DaysMinus
All Implemented Interfaces:
Function

public final class DaysMinus
extends Object
implements Function

daysminus(y,m,d,n): a date n days before a given date. Accepts fractional days.


Constructor Summary
DaysMinus()
           
 
Method Summary
 Decimal calculate(Decimal... aArgs)
          Takes 4 arguments, consisting of a year-month-day triplet, and the number of days to subtract from it.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaysMinus

public DaysMinus()
Method Detail

calculate

public Decimal calculate(Decimal... aArgs)
Takes 4 arguments, consisting of a year-month-day triplet, and the number of days to subtract from it. The year-month-day triplet satisfies Check.date(Decimal, Decimal, Decimal).

Example (with Decimals represented by their values, for convenience):

//the day before 1957-10-04:
daysminus(1957,10,4,1) => 19571003

The return value is an encoding of a date into a Decimal. In the above example, the returned date is

1957-10-03 (October 3, 1957)
Any decimal portion in the return value reflects a fraction of a day.

Specified by:
calculate in interface Function
Parameters:
aArgs - 0 or more arguments to the function.

Formula 1.0.0

Copyright Hirondelle Systems. Published January 31, 2013