DeferredQueue

public class DeferredQueue implements EventQueue

This class implements the deferred event queue used by CloudSim. The event queue uses a linked list to store the events.

Author:Marcos Dias de Assuncao

See also: CloudSim, SimEvent

Methods

addEvent

public 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.

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

clear

public void clear()

Clears the queue.

first

public SimEvent first()

isEmpty

public boolean isEmpty()

iterator

public Iterator<SimEvent> iterator()

Returns an iterator to the events in the queue.

Returns:the iterator

remove

public boolean remove(SimEvent event)

Removes the event from the queue.

Parameters:
  • event – the event
Returns:

true, if successful

size

public int size()

Returns the size of this event queue.

Returns:the number of events in the queue.

stream

public Stream<SimEvent> stream()

Returns a stream to the elements into the queue.

Returns:the stream