Class DeplayedEvent
java.lang.Object
cl.netswitch.lib.server.DeplayedEvent
- All Implemented Interfaces:
Comparable<Delayed>, Delayed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intCompares this DeplayedEvent with the specified object for order.abstract voiddispatch()Dispatched this DeplayedEvent to the target listener.final booleanIndicates whether some other object is "equal to" this DeplayedEvent.final longReturns the remaining delay in the given time unit.final inthashCode()Returns a hash code value of this DeplayedEvent.final longreset()Resets the expiration time of this DeplayedEvent for reuse.
-
Constructor Details
-
DeplayedEvent
public DeplayedEvent(long delay) Constructs a newDeplayedEventinstance.- Parameters:
delay- the delay of this DeplayedEvent (milliseconds).- Throws:
IllegalArgumentException- ifdelayis negative.
-
-
Method Details
-
reset
public final long reset()Resets the expiration time of this DeplayedEvent for reuse.- Returns:
- the delay between consecutive executions (milliseconds).
-
getDelay
Returns the remaining delay in the given time unit.- Specified by:
getDelayin interfaceDelayed- Parameters:
unit- the required time unit of the output- Returns:
- the remaining delay in the given time unit.
- Throws:
NullPointerException- ifunitisnull.
-
hashCode
-
equals
-
compareTo
Compares this DeplayedEvent with the specified object for order.- Specified by:
compareToin interfaceComparable<Delayed>- Parameters:
that- the object to compare to this DeplayedEvent.- Returns:
- a negative integer, zero, or a positive integer as this object
is less than, equal to, or greater than
thatobject. - Throws:
NullPointerException- ifthatisnull.
-
dispatch
-