public class InputQueue
extends java.lang.Object
Behaviour. This
Behaviour will be restarted each time an object is inserted in the
queue.
This class can be effectively used in combination with the
Event class to support a synchronization between the
external therad (posting the event in the InputQueue)
and the Agent thread (processing the event).Event| Constructor and Description |
|---|
InputQueue()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
associate(Behaviour b)
Associate this
InputQueue object with the indicated
Behaviour so that it will be restarted each time
a new object is inserted. |
void |
clear()
Remove all elements from this queue.
|
java.lang.Object |
get()
Extract the first object in the queue (if any).
|
void |
put(java.lang.Object obj)
Insert an object into the queue.
|
public void associate(Behaviour b)
InputQueue object with the indicated
Behaviour so that it will be restarted each time
a new object is inserted.b - The Behaviour to associate.public void put(java.lang.Object obj)
Behaviour
associated to this InputQueue it will be restarted.obj - The object to insert.public java.lang.Object get()
null if
the queue is empty.public void clear()