|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectthreadExamples.BatonMessageBox<V>
V - The type of object that can be put into a BatonMessageBox.public class BatonMessageBox<V>
Implements a message box which can hold only a single
message at a time. Behavior is almost identical to that of
SimpleMessageBox, but the implementation
is different: put and get are
not synchronized methods, but instead use an explicit
(though otherwise unimportant) object for synchronization.
| Constructor Summary | |
|---|---|
BatonMessageBox()
Creates an empty BatonMessageBox. |
|
| Method Summary | |
|---|---|
V |
get()
Waits until there is something in this BatonMessageBox, then removes and
returns it. |
void |
put(V nextValue)
Waits until this BatonMessageBox is empty, then puts
the given object into it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatonMessageBox()
| Method Detail |
|---|
public void put(V nextValue)
BatonMessageBox is empty, then puts
the given object into it.
nextValue - The object to be added.public V get()
BatonMessageBox, then removes and
returns it.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||