Class wb.Sync
All Packages Class Hierarchy This Package Previous Next Index
Class wb.Sync
java.lang.Object
|
+----wb.Sync
- public class Sync
- extends Object
This class enables synchronizing Data/Threads.
Originally designed to cater the problem of Producer/Consumer.
-
Sync()
- Creates a new Sync Class
-
get()
- Gets the Stored Object and which is stored using put
would wait until the data is available
-
put(Object)
- Store the Object and can be retrieved using get
Sync
public Sync()
- Creates a new Sync Class
put
public synchronized void put(Object arg)
- Store the Object and can be retrieved using get
- Parameters:
- arg - the object that is stored
get
public synchronized Object get()
- Gets the Stored Object and which is stored using put
would wait until the data is available
- Returns:
- Object the object that is stored
null if there are none.
All Packages Class Hierarchy This Package Previous Next Index