biweekly.util
Class Period

java.lang.Object
  extended by biweekly.util.Period

public final class Period
extends Object

A period of time.

Author:
Michael Angstadt

Constructor Summary
Period(Date startDate, Date endDate)
          Creates a new time period.
Period(Date startDate, Duration duration)
          Creates a new time period.
Period(Period period)
          Copies an existing time period.
 
Method Summary
 boolean equals(Object obj)
           
 Duration getDuration()
          Gets the length of time after the start date.
 Date getEndDate()
          Gets the end date.
 Date getStartDate()
          Gets the start date.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Period

public Period(Date startDate,
              Date endDate)
Creates a new time period.

Parameters:
startDate - the start date
endDate - the end date

Period

public Period(Date startDate,
              Duration duration)
Creates a new time period.

Parameters:
startDate - the start date
duration - the length of time after the start date

Period

public Period(Period period)
Copies an existing time period.

Parameters:
period - the period to copy
Method Detail

getStartDate

public Date getStartDate()
Gets the start date.

Returns:
the start date

getEndDate

public Date getEndDate()
Gets the end date. This will be null if a duration was defined.

Returns:
the end date or null if not set

getDuration

public Duration getDuration()
Gets the length of time after the start date. This will be null if an end date was defined.

Returns:
the duration or null if not set

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 Michael Angstadt. All Rights Reserved.