EventQueue

public interface EventQueue

An interface to be implemented by event queues.

Author:Marcos Dias de Assuncao, Manoel Campos da Silva Filho

Methods

addEvent

void addEvent(SimEvent newEvent)

Adds a new event to the queue. Adding a new event to the queue preserves the temporal order of the events in the queue.

Parameters:
  • newEvent – The event to be put in the queue.

first

SimEvent first()

Gets the first element of the queue.

Throws:
  • NoSuchElementException – when the queue is empty
Returns:

the first element

isEmpty

boolean isEmpty()

Checks if the queue is empty.

Returns:true if the queue is empty, false otherwise

iterator

Iterator<SimEvent> iterator()

Returns an iterator to the elements into the queue.

Returns:the iterator

size

int size()

Returns the size of this event queue.

Returns:the size

stream

Stream<SimEvent> stream()

Returns a stream to the elements into the queue.

Returns:the stream