Documentation of 'org.jfin.date.Period' Java class
Period
org.jfin.date

Class Period

  • All Implemented Interfaces:
    java.lang.Comparable
    Direct Known Subclasses:
    AccrualPeriod, NotionalPeriod


    public class Period
    extends java.lang.Object
    implements java.lang.Comparable
    Class representing a period between two dates. Instances of this class may also contain 'notional' start and end dates which are required to accurately calculate the day count fractions of irregular length periods within a longer schedule.
    • Constructor Detail

      • Period

        public Period()
        Default constructor
      • Period

        public Period(Period toCopy)
        Copy constructor
        Parameters:
        toCopy - The period to copy
      • Period

        public Period(java.util.Calendar startCalendar,
                      java.util.Calendar endCalendar)
        Parameters:
        startCalendar - (Start of period).
        endCalendar - (End of period).
      • Period

        public Period(java.util.Calendar startCalendar,
                      java.util.Calendar endCalendar,
                      java.util.Calendar referenceStartCalendar,
                      java.util.Calendar referenceEndCalendar)
        Parameters:
        startCalendar - (Start of period).
        endCalendar - (End of period).
        referenceStartCalendar - (Notional start of period).
        referenceEndCalendar - (Notional end of period).
    • Method Detail

      • clone

        public Period clone()
        Overrides:
        clone in class java.lang.Object
      • getStartCalendar

        public java.util.Calendar getStartCalendar()
        Returns:
        Returns the startCalendar (Start of period).
      • setStartCalendar

        public void setStartCalendar(java.util.Calendar calendar)
        Parameters:
        calendar - The startCalendar to set (Start of period).
      • getEndCalendar

        public java.util.Calendar getEndCalendar()
        Returns:
        Returns the endCalendar (End of period).
      • setEndCalendar

        public void setEndCalendar(java.util.Calendar calendar)
        Parameters:
        calendar - The endCalendar to set (End of period).
      • getReferenceEndCalendar

        public java.util.Calendar getReferenceEndCalendar()
        Returns:
        Returns the referenceEndCalendar.
      • setReferenceEndCalendar

        public void setReferenceEndCalendar(java.util.Calendar referenceEndCalendar)
        Parameters:
        referenceEndCalendar - The referenceEndCalendar to set.
      • getReferenceStartCalendar

        public java.util.Calendar getReferenceStartCalendar()
        Returns:
        Returns the referenceStartCalendar.
      • setReferenceStartCalendar

        public void setReferenceStartCalendar(java.util.Calendar referenceStartCalendar)
        Parameters:
        referenceStartCalendar - The referenceStartCalendar to set.
      • toString

        public java.lang.String toString()
        Creates a human readable String representing this period, e.g: 2005/1/1 - 2006/12/30
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo(java.lang.Object arg0)
        Compares the midpoint of this Period with arg0. Arg0 can be either another Period or a Calendar.
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        arg0 - The object to compare to
        Returns:
        -1 if arg0 before the midpoint, 0 if arg0 equals or has the same midpoint (within an hour), 1 if arg0 after the midpoint

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.