J-Sim v1.2.1-p7 API

drcl.util.queue
Class FiniteVSSimpleQueue

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.FiniteVSSimpleQueue
All Implemented Interfaces:
java.lang.Cloneable, FiniteVSQueue, ObjectDuplicable, Queue, java.io.Serializable, VariableSizeQueue

public class FiniteVSSimpleQueue
extends VSSimpleQueue
implements FiniteVSQueue

Variable-size version of SimpleQueue.

See Also:
Serialized Form

Constructor Summary
FiniteVSSimpleQueue()
           
 
Method Summary
 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 enqueueAfter(java.lang.Object previousElement_, java.lang.Object element_, int size_)
          Enqueues the element right after the previousElement_ element and associates the element with a key equal to the previous element's.
 boolean enqueueAt(int pos_, double key_, java.lang.Object element_, int size_)
          Enqueues the element at the position specified with the associated key.
 int getCapacity()
           
 boolean isFull()
          Returns true if this queue is full.
 boolean isFull(int size_)
          Returns true if this queue is overflowed with the addition of size_.
 void merge(Queue that_)
          Enqueues the elements in that_ by the order of that_.dequeue().
 java.lang.String oneline()
          Prints the content of the queue in one line of string.
 void setCapacity(int cap_)
           
 
Methods inherited from class drcl.util.queue.VSSimpleQueue
_retrieveAll, contains, containsKey, dequeue, dequeue, firstElement, firstKey, getElementEnumerator, getKeyEnumerator, getLength, getSize, keys, lastElement, lastKey, remove, remove, remove, removeAll, removeAll, reset, retrieveAll, retrieveAll, retrieveAt, retrieveBy, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface drcl.util.queue.VariableSizeQueue
getSize
 
Methods inherited from interface drcl.util.queue.Queue
_retrieveAll, contains, containsKey, dequeue, dequeue, diag, enqueue, enqueue, enqueueAfter, enqueueAt, firstElement, firstKey, getElementEnumerator, getKeyEnumerator, getLength, info, info, info, isEmpty, keys, lastElement, lastKey, remove, remove, remove, removeAll, removeAll, reset, retrieveAll, retrieveAll, retrieveAt, retrieveBy, retrieveKey, retrieveKeyAt
 

Constructor Detail

FiniteVSSimpleQueue

public FiniteVSSimpleQueue()
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

enqueueAfter

public boolean enqueueAfter(java.lang.Object previousElement_,
                            java.lang.Object element_,
                            int size_)
Description copied from interface: VariableSizeQueue
Enqueues the element right after the previousElement_ element and associates the element with a key equal to the previous element's.

Specified by:
enqueueAfter in interface VariableSizeQueue
Overrides:
enqueueAfter 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

oneline

public java.lang.String oneline()
Description copied from interface: Queue
Prints the content of the queue in one line of string.

Specified by:
oneline in interface Queue
Overrides:
oneline in class VSSimpleQueue

getCapacity

public int getCapacity()
Specified by:
getCapacity in interface FiniteVSQueue

setCapacity

public void setCapacity(int cap_)
Specified by:
setCapacity in interface FiniteVSQueue

isFull

public boolean isFull()
Description copied from interface: FiniteVSQueue
Returns true if this queue is full.

Specified by:
isFull in interface FiniteVSQueue

isFull

public boolean isFull(int size_)
Description copied from interface: FiniteVSQueue
Returns true if this queue is overflowed with the addition of size_.

Specified by:
isFull in interface FiniteVSQueue

J-Sim v1.2.1-p7 API

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