DRCL J-Sim API

drcl.util.queue
Class FiniteFIFOQueue

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.util.queue.QueueImpl
          extended bydrcl.util.queue.FIFOQueue
              extended bydrcl.util.queue.FiniteFIFOQueue
All Implemented Interfaces:
java.lang.Cloneable, FiniteQueue, ObjectCloneable, ObjectDuplicable, Queue, java.io.Serializable

public class FiniteFIFOQueue
extends FIFOQueue
implements FiniteQueue

Finite-length version of FIFOQueue.

See Also:
Serialized Form

Constructor Summary
FiniteFIFOQueue()
           
FiniteFIFOQueue(int capacity_)
           
 
Method Summary
 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 enqueueAfter(java.lang.Object previousElement_, java.lang.Object element_)
          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_)
          Enqueues the element at the position specified with the associated key.
 int getCapacity()
           
 boolean isFull()
          Returns true if this queue is full.
 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.FIFOQueue
_retrieveAll, contains, containsKey, dequeue, dequeue, firstElement, firstKey, getElementEnumerator, getKeyEnumerator, getLength, keys, lastElement, lastKey, merge, remove, remove, remove, removeAll, removeAll, removeLast, reset, retrieveAll, retrieveAll, retrieveAt, retrieveBy, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface drcl.util.queue.Queue
_retrieveAll, contains, containsKey, dequeue, dequeue, diag, firstElement, firstKey, getElementEnumerator, getKeyEnumerator, getLength, info, info, info, isEmpty, keys, lastElement, lastKey, merge, remove, remove, remove, removeAll, removeAll, reset, retrieveAll, retrieveAll, retrieveAt, retrieveBy, retrieveKey, retrieveKeyAt
 

Constructor Detail

FiniteFIFOQueue

public FiniteFIFOQueue()

FiniteFIFOQueue

public FiniteFIFOQueue(int capacity_)
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 FIFOQueue

enqueueAfter

public boolean enqueueAfter(java.lang.Object previousElement_,
                            java.lang.Object element_)
Description copied from interface: Queue
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 Queue
Overrides:
enqueueAfter in class FIFOQueue

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 FIFOQueue

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 FIFOQueue

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 FIFOQueue

getCapacity

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

setCapacity

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

isFull

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

Specified by:
isFull in interface FiniteQueue

DRCL J-Sim API

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