Class FutureQueue

  • All Implemented Interfaces:
    EventQueue

    public class FutureQueue
    extends Object
    implements EventQueue
    This class implements the future event queue used by CloudSim. The event queue uses a TreeSet in order to store the events.
    Since:
    CloudSim Toolkit 1.0
    Author:
    Marcos Dias de Assuncao
    See Also:
    TreeSet
    • Constructor Detail

      • FutureQueue

        public FutureQueue()
    • Method Detail

      • addEvent

        public void addEvent​(SimEvent newEvent)
        Description copied from interface: EventQueue
        Adds a new event to the queue. Adding a new event to the queue preserves the temporal order of the events in the queue.
        Specified by:
        addEvent in interface EventQueue
        Parameters:
        newEvent - The event to be put in the queue.
      • 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.
      • stream

        public Stream<SimEvent> stream()
        Description copied from interface: EventQueue
        Returns a stream to the elements into the queue.
        Specified by:
        stream in interface EventQueue
        Returns:
        the stream
      • size

        public int size()
        Description copied from interface: EventQueue
        Returns the size of this event queue.
        Specified by:
        size in interface EventQueue
        Returns:
        the size
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: EventQueue
        Checks if the queue is empty.
        Specified by:
        isEmpty in interface EventQueue
        Returns:
        true if the queue is empty, false otherwise
      • 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)
      • clear

        public void clear()
        Clears the queue.