SimJava 2.0.1

eduni.simjava
Class Evqueue

Object
  extended by AbstractCollection<E>
      extended by AbstractList<E>
          extended by AbstractSequentialList<E>
              extended by LinkedList
                  extended by Evqueue
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, Deque, List, Queue

 class Evqueue
extends LinkedList

This class implements the event queue used by Sim_system.

The event queue is separated into two subqueues, the future queue and the deferred queue. Newly arrived events are added to the future queue while events that the receiving entity is unable to process are placed in the deferred queue. The current implementation uses a Vector to store the events received.

This class is used internally by Sim_system and should not be directly accessed.

Version:
0.1, 25 June 1995
Author:
Ross McNab
See Also:
Sim_system

Field Summary
(package private)  double max_time
           
 
Fields inherited from class AbstractList
modCount
 
Constructor Summary
Evqueue()
          Allocates a new Evqueue object.
 
Method Summary
 void add_event(Sim_event new_event)
          Add a new event to the queue.
 Sim_event pop()
          Remove and return the event at the top of the queue.
 Sim_event top()
          Return the event at the top of the queue, without removing it.
 
Methods inherited from class LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class AbstractSequentialList
iterator
 
Methods inherited from class AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 
Methods inherited from interface Deque
iterator
 

Field Detail

max_time

double max_time
Constructor Detail

Evqueue

public Evqueue()
Allocates a new Evqueue object.

Method Detail

pop

public Sim_event pop()
Remove and return the event at the top of the queue.

Specified by:
pop in interface Deque
Overrides:
pop in class LinkedList
Returns:
The next event.

top

public Sim_event top()
Return the event at the top of the queue, without removing it.

Returns:
The next event.

add_event

public void add_event(Sim_event new_event)
Add a new event to the queue. Adding a new event to the queue preserves the temporal order of the events in the queue.

Parameters:
new_event - The event to be put on the queue.

SimJava 2.0.1

The University of Edinburgh, 2009