public class SimpleInterval extends java.lang.Object implements Interval, java.io.Serializable
END_OF_TIME, START_OF_TIME
Constructor and Description |
---|
SimpleInterval(java.util.Date on) |
SimpleInterval(java.util.Date from,
java.util.Date to)
Constructor for an interval between two dates.
|
SimpleInterval(Interval other)
The copy constructor.
|
SimpleInterval(long fromTime,
long toTime)
Constructor for an interval between two dates given as milliseconds.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Test if two intervals are equivalent.
|
java.util.Date |
getFromDate()
The date the interval is from which includes this date.
|
java.util.Date |
getToDate()
The date the interval is up to but excluding.
|
int |
hashCode()
Crude implementation of hashCode, so intervals could
be stored in HashSets.
|
java.lang.String |
toString()
Return a string representation of this interval.
|
public SimpleInterval(java.util.Date on)
on
- public SimpleInterval(java.util.Date from, java.util.Date to)
from
- The starting date.to
- The ending date.public SimpleInterval(long fromTime, long toTime)
fromTime
- toTime
- public SimpleInterval(Interval other)
other
- The other interval.public java.util.Date getFromDate()
Interval
getFromDate
in interface Interval
public java.util.Date getToDate()
Interval
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
Intervals are equivalent if there start and end times are the same.
equals
in class java.lang.Object
other
- The interval to test against.public java.lang.String toString()
toString
in class java.lang.Object