cdx.scorebot.util
Class TimestampRange

java.lang.Object
  extended by cdx.scorebot.util.TimestampRange
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TimestampRange>

public class TimestampRange
extends java.lang.Object
implements java.lang.Comparable<TimestampRange>, java.io.Serializable

a start-end pair of Timestamps

Author:
David Underhill
See Also:
Serialized Form

Constructor Summary
TimestampRange()
          sets both timestamps to the current time
TimestampRange(Timestamp startTime, Timestamp endTime)
          sets both timestamps to the specified times
 
Method Summary
 int compareTo(TimestampRange tr)
          Compares this TimestampRange's start date with the specified TimestampRange: earliest start timestamp will come first.
 boolean equals(java.lang.Object o)
           
 Timestamp getEndTime()
          gets the end time
 Timestamp getStartTime()
          gets the start time
 void setEndTime(Timestamp endTime)
          sets the end time
 void setStartTime(Timestamp startTime)
          sets the start time
 java.lang.String toString()
          returns the date/time of this timestamp range as dd-MMM-yyyy HH:mm to dd-MMM-yyyy HH:mm
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimestampRange

public TimestampRange()
sets both timestamps to the current time


TimestampRange

public TimestampRange(Timestamp startTime,
                      Timestamp endTime)
sets both timestamps to the specified times

Parameters:
startTime - beginning time of the TimestampRange
endTime - ending time of the TimestampRange
Method Detail

compareTo

public int compareTo(TimestampRange tr)
Compares this TimestampRange's start date with the specified TimestampRange: earliest start timestamp will come first.

Specified by:
compareTo in interface java.lang.Comparable<TimestampRange>
Parameters:
tr - the TimestampRange to compare this to
Returns:
-1, 0, 1 as this TimestampRange is less than, equal to, or greater than the specified TimestampRange.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
returns the date/time of this timestamp range as dd-MMM-yyyy HH:mm to dd-MMM-yyyy HH:mm

Overrides:
toString in class java.lang.Object

getStartTime

public Timestamp getStartTime()
gets the start time


setStartTime

public void setStartTime(Timestamp startTime)
sets the start time


getEndTime

public Timestamp getEndTime()
gets the end time


setEndTime

public void setEndTime(Timestamp endTime)
sets the end time