public abstract class DayCountConvention_ACT extends Object implements DayCountConventionInterface
| Constructor and Description |
|---|
DayCountConvention_ACT()
Create an ACT day count convention.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
daysBetween(Calendar startDate,
Calendar endDate)
Returns the number of days, between two Calendar dates.
|
double |
getDaycount(Calendar startDate,
Calendar endDate)
Return the number of days between startDate and endDate given the
specific daycount convention.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDaycountFractionpublic DayCountConvention_ACT()
public double getDaycount(Calendar startDate, Calendar endDate)
DayCountConventionInterfacegetDaycount in interface DayCountConventionInterfacestartDate - The start date given as a Calendar.endDate - The end date given as a Calendar.public static double daysBetween(Calendar startDate, Calendar endDate)
Math.round( ((double)(endDate.getTimeInMillis()-startDate.getTimeInMillis())) / 1000.0 / 60.0 / 60.0 / 24)
For more accurate calculation consider org.joda.time.Days.
However, the method is correct if each calendar is on the same time and they differ only by days.
startDate - The start date of the interval.endDate - The end date of the interval.Copyright © 2015. All rights reserved.