public class EventQueue
extends java.lang.Object
| Constructor and Description |
|---|
EventQueue(java.util.function.Consumer<java.lang.Object> eventConsumer)
Create an event queue whose events will be consumed by the specified
consumer.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getSize() |
boolean |
isEmpty()
Returns whether this queue is empty.
|
void |
put(java.lang.Object event)
Puts an event in the queue, that will be provided to the consumer
(if the event queue hasn't been stopped).
|
void |
stop()
Stop providing events to the consumer.
|
public EventQueue(java.util.function.Consumer<java.lang.Object> eventConsumer)
eventConsumer - the target of eventspublic void put(java.lang.Object event)
event - the event for the queuepublic void stop()
public boolean isEmpty()
public int getSize()