|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--drcl.DrclObj
|
+--drcl.util.queue.Queue
|
+--drcl.util.queue.CalendarQueue
| Constructor Summary | |
CalendarQueue()
|
|
| Method Summary | |
drcl.util.queue.CalendarQueue._Element |
_dequeue()
|
Element[] |
_retrieveAll()
Returns all the elements in the queue sorted in the ascending order of the key values and the order of time of enqueues. |
boolean |
contains(java.lang.Object o_)
Returns true if the queue contains the element. |
boolean |
containsKey(double key_)
Returns true if the queue contains the key. |
java.lang.Object |
dequeue()
Dequeues and returns the element with the smallest key. |
java.lang.Object |
dequeue(double key_)
Dequeues and returns the first element with the key matched the argument. |
java.lang.String |
diag(boolean listElement_)
Prints out for diagnosis. |
boolean |
enqueue(double key_,
java.lang.Object o_)
Enqueues the element with the associated key. |
boolean |
enqueue(double key_,
java.lang.Object o_,
int size_)
Enqueues the element with the associated key. |
boolean |
enqueue(java.lang.Object o_)
Associates the element with the largest key in the queue and then enqueues the element. |
boolean |
enqueue(java.lang.Object o_,
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_)
Enqueues the element right after the previousElement_ element and
associates the element with a key equal to the previous element's. |
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. |
java.lang.Object |
firstElement()
Returns the first element in the queue, no dequeue is performed. |
double |
firstKey()
Returns the first key in the queue, no dequeue is performed. |
java.util.Enumeration |
getElementEnumerator()
|
java.util.Enumeration |
getKeyEnumerator()
|
int |
getLength()
Returns the current length of the queue. |
int |
getMaxSize()
Returns the maximum size of the queue. |
int |
getSize()
Returns the current size of the queue. |
java.lang.String |
info()
Prints the content of the queue. |
java.lang.String |
info(java.lang.String prefix_)
Prints the content of the queue. |
boolean |
isEmpty()
Returns true if the queue is empty. |
boolean |
isFull()
Returns true if the queue is full. |
double[] |
keys()
Returns all the keys in the queue. |
java.lang.Object |
lastElement()
Returns the last element in the queue, no dequeue is performed. |
double |
lastKey()
Returns the last key in the queue, no dequeue is performed. |
java.lang.String |
oneline()
Prints the content of the queue in one line of string. |
java.lang.Object |
remove(double key_,
java.lang.Object obj_)
Removes the first element that has the same key and equals() the argument. |
java.lang.Object |
remove(int n_)
Removes and returns the nth element in the queue. |
java.lang.Object |
remove(java.lang.Object obj_)
Removes the first element that equals() the argument. |
void |
removeAll(double key_,
java.lang.Object o_)
Removes all the elements that match both the argument key and element. |
void |
removeAll(java.lang.Object o_)
Removes all the elements that equals() the argument. |
void |
reset()
Empties the queue. |
void |
resize(int newsize_)
|
java.lang.Object[] |
retrieveAll()
Returns all the elements in the queue sorted in the ascending order of the key values and the order of time of enqueues. |
java.lang.Object[] |
retrieveAll(double key_)
Returns all the elements with the keys matched to the argument. |
java.lang.Object |
retrieveAt(int n_)
Returns the nth element in the queue, no dequeue is performed. |
java.lang.Object |
retrieveBy(double key_)
Returns the first element with the key matched to the argument. |
double |
retrieveKey(java.lang.Object o_)
Returns the key of the first matched element in this queue, Double.NaN if no match is found. |
double |
retrieveKeyAt(int n_)
Returns the nth key in the queue, Double.NaN if the current size of the queue is smaller than (n+1). |
void |
setMaxSize(int size_)
|
void |
setMaxSize(int size_,
boolean truncate_)
Sets the maximum size of the queue. |
| Methods inherited from class drcl.util.queue.Queue |
duplicate, enqueueAt, getAvailableSize, info, isFull, merge |
| 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 |
public CalendarQueue()
| Method Detail |
public boolean enqueue(double key_,
java.lang.Object o_)
Queueenqueue in class Queuedrcl.util.queue.Queuekey_ - the associated key.element_ - the element to be put in the queue.public java.lang.Object dequeue()
Queuedequeue in class Queuedrcl.util.queue.Queuepublic drcl.util.queue.CalendarQueue._Element _dequeue()
public double firstKey()
Queuejava.lang.Double.NaN if the queue is empty.firstKey in class Queuepublic java.lang.Object firstElement()
QueuefirstElement in class Queuepublic void resize(int newsize_)
public java.lang.Object remove(double key_,
java.lang.Object obj_)
Queueequals() the argument.remove in class Queuedrcl.util.queue.Queuepublic java.lang.Object remove(java.lang.Object obj_)
Queueequals() the argument.remove in class Queuedrcl.util.queue.Queuepublic boolean isEmpty()
QueueisEmpty in class Queuepublic boolean isFull()
QueueisFull in class Queuepublic void setMaxSize(int size_)
public void setMaxSize(int size_,
boolean truncate_)
Queuetruncate_ is set,
then the size_th element, and the elements after,
are removed from the queue.
- Overrides:
setMaxSize in class Queue
public int getSize()
QueuegetSize in class Queuepublic int getLength()
QueuegetLength in class Queuepublic int getMaxSize()
QueuegetMaxSize in class Queuepublic double[] keys()
Queuekeys in class Queuepublic java.lang.Object[] retrieveAll()
QueueretrieveAll in class Queuepublic void reset()
Queuereset in class Queuepublic java.lang.String info(java.lang.String prefix_)
info in class Queueprefix_ - prefix of each line when printing.public java.lang.String info()
info in class Queuepublic java.lang.String oneline()
oneline in class Queuepublic java.lang.String diag(boolean listElement_)
QueueQueue.info().diag in class Queuepublic java.util.Enumeration getElementEnumerator()
getElementEnumerator in class Queuepublic java.util.Enumeration getKeyEnumerator()
getKeyEnumerator in class Queue
public boolean enqueue(java.lang.Object o_,
int size_)
Queueenqueue in class Queuedrcl.util.queue.Queuesize_ - size of the element.
public boolean enqueue(double key_,
java.lang.Object o_,
int size_)
Queueenqueue in class Queuedrcl.util.queue.Queuekey_ - the associated key.element_ - the element to be put in the queue.size_ - size of the element.
public boolean enqueueAt(int pos_,
double key_,
java.lang.Object element_,
int size_)
QueueenqueueAt in class Queuedrcl.util.queue.Queuepos_ - the position.key_ - the associated key.element_ - the element to be put in the queue.size_ - size of the element.
public boolean enqueueAfter(java.lang.Object previousElement_,
java.lang.Object element_,
int size_)
QueuepreviousElement_ element and
associates the element with a key equal to the previous element's.enqueueAfter in class Queuedrcl.util.queue.QueuepreviousElement_ - the previous element.element_ - the element to be put in the queue.size_ - size of the element.previousElement_ does not appear or the queue is full.
public boolean enqueueAfter(java.lang.Object previousElement_,
java.lang.Object element_)
QueuepreviousElement_ element and
associates the element with a key equal to the previous element's.enqueueAfter in class Queuedrcl.util.queue.QueuepreviousElement_ - the previous element.element_ - the element to be put in the queue.previousElement_ does not appear or the queue is full.public boolean enqueue(java.lang.Object o_)
Queueenqueue in class Queuedrcl.util.queue.Queuepublic java.lang.Object[] retrieveAll(double key_)
QueueretrieveAll in class Queuepublic double retrieveKey(java.lang.Object o_)
QueueretrieveKey in class Queuepublic java.lang.Object dequeue(double key_)
Queuedequeue in class Queuedrcl.util.queue.Queuepublic java.lang.Object retrieveBy(double key_)
QueueretrieveBy in class Queuepublic void removeAll(java.lang.Object o_)
Queueequals() the argument.removeAll in class Queue
public void removeAll(double key_,
java.lang.Object o_)
QueueremoveAll in class Queuepublic double lastKey()
Queuejava.lang.Double.NaN if the queue is empty.lastKey in class Queuepublic java.lang.Object lastElement()
QueuelastElement in class Queuepublic double retrieveKeyAt(int n_)
QueueretrieveKeyAt in class Queuepublic java.lang.Object retrieveAt(int n_)
QueueretrieveAt in class Queuepublic java.lang.Object remove(int n_)
Queueremove in class Queuepublic boolean containsKey(double key_)
QueuecontainsKey in class Queuepublic Element[] _retrieveAll()
Queue_retrieveAll in class Queuepublic boolean contains(java.lang.Object o_)
Queuecontains in class Queue
|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||