org.jquantlib.daycounters
Class DayCounter
- java.lang.Object
-
- org.jquantlib.daycounters.DayCounter
-
- Direct Known Subclasses:
- Actual360, Actual365Fixed, ActualActual, Business252, SimpleDayCounter, Thirty360
public class DayCounter extends java.lang.ObjectThis interface provides methods for determining the length of a time period according to given market convention, both as a number of days and as a year fraction.- See Also:
- Day count convention
-
-
Constructor Summary
Constructors Constructor and Description DayCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description longdayCount(Date dateStart, Date dateEnd)Returns the number of days between two datesbooleanempty()Returns whether or not the day counter is initializedbooleaneq(DayCounter another)Returns true ifthisandotherbelong to the same derived class.booleanequals(java.lang.Object obj)inthashCode()java.lang.Stringname()booleanne(DayCounter another)java.lang.StringtoString()doubleyearFraction(Date dateStart, Date dateEnd)Returns the period between two dates as a fraction of yeardoubleyearFraction(Date dateStart, Date dateEnd, Date refPeriodStart, Date refPeriodEnd)Returns the period between two dates as a fraction of year, considering referencing dates for both.
-
-
-
Method Detail
-
empty
public boolean empty()
Returns whether or not the day counter is initialized
-
name
public java.lang.String name()
- Returns:
- the name of this DayCounter
-
dayCount
public long dayCount(Date dateStart, Date dateEnd)
Returns the number of days between two dates- Parameters:
dateStart- is the starting DatedateEnd- is the ending Date- Returns:
- the number of days between two dates.
-
yearFraction
public double yearFraction(Date dateStart, Date dateEnd)
Returns the period between two dates as a fraction of year- Parameters:
dateStart-dateEnd-- Returns:
- the period between two dates as a fraction of year
-
yearFraction
public double yearFraction(Date dateStart, Date dateEnd, Date refPeriodStart, Date refPeriodEnd)
Returns the period between two dates as a fraction of year, considering referencing dates for both.- Parameters:
dateStart-dateEnd-refPeriodStart-refPeriodEnd-- Returns:
- the period between two dates as a fraction of year, considering referencing dates for both.
-
eq
public boolean eq(DayCounter another)
Returns true ifthisandotherbelong to the same derived class.
-
ne
public boolean ne(DayCounter another)
- Returns:
- the negation of
eq(DayCounter)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG