public class TimedEvent extends java.lang.Object implements java.lang.Comparable<TimedEvent>
CQComparator
,
Time
Red (liuj) |
Yellow (eal) |
Modifier and Type | Class and Description |
---|---|
static class |
TimedEvent.TimeComparator
This class implements the CQComparator interface.
|
Modifier and Type | Field and Description |
---|---|
java.lang.Object |
contents
The event object.
|
Time |
timeStamp
The time stamp.
|
Constructor and Description |
---|
TimedEvent(Time time,
java.lang.Object obj)
Construct an event with the specified time stamp and contents.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TimedEvent timedEvent)
Compare two TimedEvents by comparing their timestamps.
|
boolean |
equals(java.lang.Object timedEvent)
Return true if this TimedEvent object has the same
timeStamp and eventObject as the given TimedEvent object.
|
int |
hashCode()
Return the hash code for the TimedEvent object.
|
java.lang.String |
toString()
Display timeStamp and contents.
|
public Time timeStamp
public java.lang.Object contents
public TimedEvent(Time time, java.lang.Object obj)
time
- The time stamp.obj
- The contents.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object timedEvent)
equals
in class java.lang.Object
timedEvent
- The TimedEvent object that this
TimedEvent object is compared to.public int compareTo(TimedEvent timedEvent)
compareTo
in interface java.lang.Comparable<TimedEvent>
timedEvent
- The event to compare against.public int hashCode()
hashCode
in class java.lang.Object