FutureQueue

public class FutureQueue implements EventQueue

This class implements the future event queue used by CloudSim. The event queue uses a TreeSet in order to store the events.

Author:Marcos Dias de Assuncao

See also: java.util.TreeSet

Methods

addEvent

public void addEvent(SimEvent newEvent)

addEventFirst

public void addEventFirst(SimEvent newEvent)

Adds a new event to the head of the queue.

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

clear

public void clear()

Clears the queue.

first

public SimEvent first()

isEmpty

public boolean isEmpty()

iterator

public Iterator<SimEvent> iterator()

remove

public boolean remove(SimEvent event)

Removes the event from the queue.

Parameters:
  • event – the event
Returns:

true, if successful

removeAll

public boolean removeAll(Collection<SimEvent> events)

Removes all the events from the queue.

Parameters:
  • events – the events
Returns:

true, if successful

removeIf

public boolean removeIf(Predicate predicate)

size

public int size()

stream

public Stream<SimEvent> stream()