|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SharedData
An object of class SharedData is a named int data value used by a SharedDataProcess. The name is established when the SharedData is constructed. It can be retrieved by calling toString().
An object reading from or writing to a SharedData object takes a fixed amount of time to complete the operation. This access time is specified in the SharedDataconstructor.
When a SharedData is constructed, its value is initialized to 0. Its value is incremented by calling write(). Its value can be read by calling read(). Writers have precedence over Readers. No Reader can read the value while Writers are waiting to write the value.
Field Summary | |
protected static long |
accessTime
accessTime is the time required to perform a data access on this SharedData. |
protected Locker |
locker
locker provides the Writer locking and Reader waiting for this SharedData. |
protected java.lang.String |
name
name is the name for this SharedData. |
protected int |
value
value is the current value of this SharedData. |
Constructor Summary | |
SharedData(java.lang.String nm,
double t)
new SharedData(nm, t) returns a new SharedData object. |
Method Summary | |
protected void |
doWrite()
doWrite() increments the value of this Writer. |
void |
read()
sd.read() reads the current value of sd. |
java.lang.String |
toString()
sd.toString() returns the name of sd. |
void |
write()
sd.write() increments the value of sd. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int value
protected static long accessTime
protected Locker locker
protected java.lang.String name
Constructor Detail |
public SharedData(java.lang.String nm, double t)
Method Detail |
public void read()
public void write()
public java.lang.String toString()
toString
in class java.lang.Object
protected void doWrite()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |