J-Sim v1.2.1-p7 API

drcl.util.queue
Class Stack

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.util.queue.QueueImpl
          extended bydrcl.util.queue.SimpleQueue
              extended bydrcl.util.queue.Stack
All Implemented Interfaces:
java.lang.Cloneable, ObjectDuplicable, Queue, java.io.Serializable

public class Stack
extends SimpleQueue

A first-in-last-out queue.

See Also:
Serialized Form

Constructor Summary
Stack()
           
 
Method Summary
 boolean containsKey(double key_)
          Returns true if the queue contains the key.
 void enqueue(double key_, java.lang.Object element_)
          Enqueues the element with the associated key.
 void enqueue(java.lang.Object element_)
          Associates the element with the largest key in the queue and then enqueues the element.
 boolean enqueueAt(int pos_, double key_, java.lang.Object element_)
          Enqueues the element at the position specified with the associated key.
 void merge(Queue that_)
          Enqueues the elements in that_ by the order of that_.dequeue().
 java.lang.Object[] retrieveAll(double key_)
          Returns all the elements with the keys matched to the argument.
 java.lang.Object retrieveBy(double key_)
          Returns the first element with the key matched to the argument.
 
Methods inherited from class drcl.util.queue.SimpleQueue
_retrieveAll, contains, dequeue, dequeue, enqueueAfter, firstElement, firstKey, getElementEnumerator, getKeyEnumerator, getLength, keys, lastElement, lastKey, oneline, remove, remove, remove, removeAll, removeAll, reset, retrieveAll, retrieveAt, retrieveKey, retrieveKeyAt
 
Methods inherited from class drcl.util.queue.QueueImpl
diag, duplicate, info, info, info, isEmpty
 
Methods inherited from class drcl.DrclObj
clone, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stack

public Stack()
Method Detail

enqueue

public void enqueue(double key_,
                    java.lang.Object element_)
Description copied from interface: Queue
Enqueues the element with the associated key. The elements in queue are sorted in the ascending order of their associated keys. If same keys appear in the queue, the element is put right after the last element with the same key.

Specified by:
enqueue in interface Queue
Overrides:
enqueue in class SimpleQueue

enqueueAt

public boolean enqueueAt(int pos_,
                         double key_,
                         java.lang.Object element_)
Description copied from interface: Queue
Enqueues the element at the position specified with the associated key. Note that the elements in queue are sorted in the ascending order of their associated keys. Enqueue fails if position and key create a conflict to the above condition.

Specified by:
enqueueAt in interface Queue
Overrides:
enqueueAt in class SimpleQueue

merge

public void merge(Queue that_)
Description copied from interface: Queue
Enqueues the elements in that_ by the order of that_.dequeue().

Specified by:
merge in interface Queue
Overrides:
merge in class SimpleQueue

enqueue

public void enqueue(java.lang.Object element_)
Description copied from interface: Queue
Associates the element with the largest key in the queue and then enqueues the element. If the queue is originally empty, then key 0.0 is assigned.

Specified by:
enqueue in interface Queue
Overrides:
enqueue in class SimpleQueue

retrieveBy

public java.lang.Object retrieveBy(double key_)
Description copied from interface: Queue
Returns the first element with the key matched to the argument. No dequeue is performed.

Specified by:
retrieveBy in interface Queue
Overrides:
retrieveBy in class SimpleQueue

retrieveAll

public java.lang.Object[] retrieveAll(double key_)
Description copied from interface: Queue
Returns all the elements with the keys matched to the argument. No dequeue is performed.

Specified by:
retrieveAll in interface Queue
Overrides:
retrieveAll in class SimpleQueue

containsKey

public boolean containsKey(double key_)
Description copied from interface: Queue
Returns true if the queue contains the key.

Specified by:
containsKey in interface Queue
Overrides:
containsKey in class SimpleQueue

J-Sim v1.2.1-p7 API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~