Package noaa.coastwatch.util
Class TimePeriod
java.lang.Object
noaa.coastwatch.util.TimePeriod
- All Implemented Interfaces:
Comparable
The
TimePeriod
class is a container for a date and
length of time.- Since:
- 3.1.8
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionTimePeriod
(Date startDate, long duration) Creates a new time period.TimePeriod
(Date startDate, Date endDate) Creates a new time period. -
Method Summary
Modifier and TypeMethodDescriptionint
long
Gets the time period duration in milliseconds.Gets the time period ending date.Gets the time period starting date.
-
Constructor Details
-
TimePeriod
Creates a new time period.- Parameters:
startDate
- the time period starting date.duration
- the time period duration in milliseconds.
-
TimePeriod
Creates a new time period.- Parameters:
startDate
- the time period starting date.endDate
- the time period ending date.- Since:
- 3.5.1
-
-
Method Details
-
getStartDate
Gets the time period starting date. -
getDuration
public long getDuration()Gets the time period duration in milliseconds. -
getEndDate
Gets the time period ending date. -
compareTo
- Specified by:
compareTo
in interfaceComparable
- Throws:
ClassCastException
-