public class TimeSpan extends java.lang.Object implements java.lang.Comparable<TimeSpan>, java.io.Serializable
| Constructor and Description |
|---|
TimeSpan(java.util.Date date)
Creates a new TimeSpan object.
|
TimeSpan(java.util.Date startDate,
java.util.Date stopDate)
Creates a new TimeSpan object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(TimeSpan span)
Compares two different TimeSpans.
|
boolean |
contains(java.util.Date testDate)
Tests whether the given date is within this TimeSpan.
|
boolean |
equals(java.lang.Object obj)
Return whether the object equals this TimeSpan.
|
long |
getDuration()
Calculates the duration of this TimeSpan
|
java.util.Date |
getStartDate()
returns the start date of the TimeSpan
|
java.util.Date |
getStopDate()
returns the stop date of the TimeSpan
|
int |
hashCode()
Return the hash code for this TimeSpan
|
TimeSpan |
intersect(TimeSpan span)
Finds when this TimeSpan and another TimeSpan are both active.
|
boolean |
isInstantaneous()
Return whether this TimeSpan is instantaneous.
|
java.lang.String |
toString()
returns a string representation of this TimeSpan
|
public TimeSpan(java.util.Date date)
date - the Start and End of the TimeSpanpublic TimeSpan(java.util.Date startDate,
java.util.Date stopDate)
startDate - the Start of the TimeSpanstopDate - the end of the TimeSpanpublic int compareTo(TimeSpan span)
compareTo in interface java.lang.Comparable<TimeSpan>span - the other TimeSpan to compare topublic boolean contains(java.util.Date testDate)
testDate - the test datepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to comparepublic long getDuration()
public java.util.Date getStartDate()
public java.util.Date getStopDate()
public int hashCode()
hashCode in class java.lang.Objectpublic TimeSpan intersect(TimeSpan span)
span - the other TimeSpan to intersect with this TimeSpanpublic boolean isInstantaneous()
public java.lang.String toString()
toString in class java.lang.Object