DRCL J-Sim API

drcl.util.queue
Class VSStack

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.util.queue.QueueImpl
          extended bydrcl.util.queue.VariableSizeQueueImpl
              extended bydrcl.util.queue.VSSimpleQueue
                  extended bydrcl.util.queue.VSStack
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, Queue, java.io.Serializable, VariableSizeQueue

public class VSStack
extends VSSimpleQueue

A first-in-last-out queue.

See Also:
Serialized Form

Constructor Summary
VSStack()
           
 
Method Summary
 boolean containsKey(double key_)
          Returns true if the queue contains the key.
 void enqueue(double key_, java.lang.Object element_, int size_)
          Enqueues the element with the associated key.
 void enqueue(java.lang.Object element_, int size_)
          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_, int size_)
          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.VSSimpleQueue
_retrieveAll, contains, dequeue, dequeue, enqueueAfter, firstElement, firstKey, getElementEnumerator, getKeyEnumerator, getLength, getSize, keys, lastElement, lastKey, oneline, remove, remove, remove, removeAll, removeAll, reset, retrieveAll, retrieveAt, retrieveKey, retrieveKeyAt
 
Methods inherited from class drcl.util.queue.VariableSizeQueueImpl
duplicate, enqueue, enqueueAfter, enqueueAt, info
 
Methods inherited from class drcl.util.queue.QueueImpl
diag, enqueue, info, info, isEmpty
 
Methods inherited from class drcl.DrclObj
clone, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface drcl.util.queue.Queue
diag, enqueue, info, info, isEmpty
 

Constructor Detail

VSStack

public VSStack()
Method Detail

enqueue

public void enqueue(double key_,
                    java.lang.Object element_,
                    int size_)
Description copied from interface: VariableSizeQueue
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 VariableSizeQueue
Overrides:
enqueue in class VSSimpleQueue

enqueueAt

public boolean enqueueAt(int pos_,
                         double key_,
                         java.lang.Object element_,
                         int size_)
Description copied from interface: VariableSizeQueue
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 VariableSizeQueue
Overrides:
enqueueAt in class VSSimpleQueue

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 VSSimpleQueue

enqueue

public void enqueue(java.lang.Object element_,
                    int size_)
Description copied from interface: VariableSizeQueue
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 VariableSizeQueue
Overrides:
enqueue in class VSSimpleQueue

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 VSSimpleQueue

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 VSSimpleQueue

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 VSSimpleQueue

DRCL J-Sim API

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