ELEMENT
- Element typeprivate static class MessageHandler.Message<ELEMENT> extends java.lang.Object implements java.lang.Comparable<MessageHandler.Message<ELEMENT>>
Modifier and Type | Field and Description |
---|---|
(package private) ELEMENT |
element
Message content
|
(package private) long |
time
Time when message should arrived
|
Constructor and Description |
---|
MessageHandler.Message(long time,
ELEMENT element)
Create a new instance of Message
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MessageHandler.Message<ELEMENT> message)
Compare with an other message, to know if this message must be receive before, after or in same time
Parent documentation: |
boolean |
equals(java.lang.Object object)
Indicates if an object is a message with same content
Parent documentation: |
ELEMENT element
long time
public MessageHandler.Message(long time, ELEMENT element)
time
- Time when message should arrivedelement
- Message contentpublic int compareTo(MessageHandler.Message<ELEMENT> message)
compareTo
in interface java.lang.Comparable<MessageHandler.Message<ELEMENT>>
message
- Message to compare withComparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Object to compare withtrue
if the object is a message with same contentObject.equals(java.lang.Object)