|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.TimerQueue
Internal class to manage all Timers using one thread. TimerQueue manages a queue of Timers. The Timers are chained together in a linked list sorted by the order in which they will expire.
Field Summary | |
private static Object |
classLock
|
private static Object |
expiredTimersKey
|
(package private) Timer |
firstTimer
|
(package private) boolean |
running
|
private static Object |
sharedInstanceKey
|
Constructor Summary | |
TimerQueue()
Constructor for TimerQueue. |
Method Summary | |
(package private) void |
addTimer(Timer timer,
long expirationTime)
|
(package private) boolean |
containsTimer(Timer timer)
|
(package private) long |
postExpiredTimers()
If there are a ton of timers, this method may never return. |
(package private) void |
removeTimer(Timer timer)
|
void |
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread.
|
static TimerQueue |
sharedInstance()
|
(package private) void |
start()
|
(package private) void |
stop()
|
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final Object sharedInstanceKey
private static final Object expiredTimersKey
Timer firstTimer
boolean running
private static final Object classLock
Constructor Detail |
public TimerQueue()
Method Detail |
public static TimerQueue sharedInstance()
void start()
void stop()
void addTimer(Timer timer, long expirationTime)
void removeTimer(Timer timer)
boolean containsTimer(Timer timer)
long postExpiredTimers()
public void run()
Runnable
Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may
take any action whatsoever.
run
in interface Runnable
Thread.run()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |