|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.javaGD.LocatorSync
public class LocatorSync
a simple synchronization class that can be used by a separate thread to wake JavaGD from waiting for a locator result. The waiting thread calls waitForAction()
which returns only after another thread calls triggerAction(double[])
.
Constructor Summary | |
---|---|
LocatorSync()
|
Method Summary | |
---|---|
void |
triggerAction(double[] result)
this methods awakens waitForAction() . |
double[] |
waitForAction()
this internal method waits until triggerAction(double[]) is called by another thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocatorSync()
Method Detail |
---|
public double[] waitForAction()
triggerAction(double[])
is called by another thread. It is implemented by using Object.wait()
and checking notificationArrived
.
triggerAction(double[])
was called - essentially the retuls to be returned by locatorpublic void triggerAction(double[] result)
waitForAction()
. It is implemented by setting notificationArrived
to true
, setting locResult
to the passed result and finally calling Object.notifyAll()
.
result
- result to pass to waitForAction()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |