WebCab Options and Futures Demo
v2.5
(J2SE Edition)

webcab.lib.calendar.cities
Class DayCountConventions

java.lang.Object
  |
  +--webcab.lib.calendar.cities.DayCountConventions

public final class DayCountConventions
extends Object

This utility class handles calculations related to day count conventions. Each day count convention is identified by one of the constant string identifiers in this class.


Field Summary
static String ACTUAL_360
          This string identifies the `Actual/360' day count convention.
static String ACTUAL_365
          This string identifies the `Actual/365' day count convention.
static String ACTUAL_ACTUAL
          This string identifies the `Actual/Actual' day count convention.
static String EUROPE_30_360
          This string identifies the European 30/360 day count convention.
static String US_30_360
          This string identifies the US 30/360 day count convention.
 
Method Summary
static int daysBetween(Date startDate, Date endDate, String dayCountConvention)
          This method returns the number of days between two dates, taking into account the given day count convention and the fact that the second date is within a year's time after the first date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

US_30_360

public static final String US_30_360
This string identifies the US 30/360 day count convention. The value of this constant is "30/360".

See Also:
Constant Field Values

EUROPE_30_360

public static final String EUROPE_30_360
This string identifies the European 30/360 day count convention. The value of this constant is "30/360E".

See Also:
Constant Field Values

ACTUAL_ACTUAL

public static final String ACTUAL_ACTUAL
This string identifies the `Actual/Actual' day count convention. The value of this constant is "A/A".

See Also:
Constant Field Values

ACTUAL_360

public static final String ACTUAL_360
This string identifies the `Actual/360' day count convention. The value of this constant is "A/360".

See Also:
Constant Field Values

ACTUAL_365

public static String ACTUAL_365
This string identifies the `Actual/365' day count convention. The value of this constant is "A/365".

Method Detail

daysBetween

public static int daysBetween(Date startDate,
                              Date endDate,
                              String dayCountConvention)
This method returns the number of days between two dates, taking into account the given day count convention and the fact that the second date is within a year's time after the first date.

Parameters:
startDate - the start date
endDate - the end date, no later than a year after startDate
dayCountConvention - one of the day count convention string constants, US_30_360, EUROPE_30_360, ACTUAL_ACTUAL, ACTUAL_360, and ACTUAL_365

WebCab Options and Futures Demo
v2.5
(J2SE Edition)