|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.util.queue.QueueImpl
Base class for implementing a queue.
| Constructor Summary | |
QueueImpl()
|
|
| Method Summary | |
abstract Element[] |
_retrieveAll()
Returns all the elements in the queue sorted in the ascending order of the key values and the order of enqueues. |
abstract boolean |
contains(java.lang.Object element_)
Returns true if the queue contains the element. |
abstract boolean |
containsKey(double key_)
Returns true if the queue contains the key. |
abstract java.lang.Object |
dequeue()
Dequeues and returns the element with the smallest key. |
abstract 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. |
void |
duplicate(java.lang.Object source_)
opies the content of the source_ object to this object. |
abstract 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. |
abstract java.lang.Object |
firstElement()
Returns the first element in the queue, no dequeue is performed. |
abstract double |
firstKey()
Returns the first key in the queue, no dequeue is performed. |
abstract java.util.Enumeration |
getElementEnumerator()
|
abstract java.util.Enumeration |
getKeyEnumerator()
|
abstract int |
getLength()
Returns the current length 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. |
java.lang.String |
info(java.lang.String prefix_,
boolean listElement_)
Prints the content of the queue. |
boolean |
isEmpty()
Returns true if the queue is empty. |
abstract double[] |
keys()
Returns all the keys in the queue. |
abstract java.lang.Object |
lastElement()
Returns the last element in the queue, no dequeue is performed. |
abstract double |
lastKey()
Returns the last key in the queue, no dequeue is performed. |
void |
merge(Queue that_)
Enqueues the elements in that_ by the order of
that_.dequeue(). |
abstract java.lang.String |
oneline()
Prints the content of the queue in one line of string. |
abstract java.lang.Object |
remove(double key_,
java.lang.Object element_)
Removes the first element that has the same key and equals()
the argument. |
abstract java.lang.Object |
remove(int n_)
Removes and returns the nth element in the queue. |
abstract java.lang.Object |
remove(java.lang.Object element_)
Removes the first element that equals() the argument. |
abstract void |
removeAll(double key_,
java.lang.Object element_)
Removes all the elements that match both the argument key and element. |
abstract void |
removeAll(java.lang.Object element_)
Removes all the elements that equals() the argument. |
abstract void |
reset()
Empties the queue. |
abstract java.lang.Object[] |
retrieveAll()
Returns all the elements in the queue sorted in the ascending order of the key values and the order of enqueues. |
abstract java.lang.Object[] |
retrieveAll(double key_)
Returns all the elements with the keys matched to the argument. |
abstract java.lang.Object |
retrieveAt(int n_)
Returns the nth element in the queue, no dequeue is performed. |
abstract java.lang.Object |
retrieveBy(double key_)
Returns the first element with the key matched to the argument. |
abstract double |
retrieveKey(java.lang.Object o_)
Returns the key of the first matched element in this queue, Double.NaN if no match is found. |
abstract double |
retrieveKeyAt(int n_)
Returns the nth key in the queue, Double.NaN if the current length of the queue is smaller than (n+1). |
| 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 QueueImpl()
| Method Detail |
public abstract void reset()
Queue
reset in interface Queuepublic boolean isEmpty()
Queue
isEmpty in interface Queue
public abstract void enqueue(double key_,
java.lang.Object element_)
Queue
enqueue in interface Queuekey_ - the associated key.element_ - the element to be put in the queue.
public boolean enqueueAt(int pos_,
double key_,
java.lang.Object element_)
Queue
enqueueAt in interface Queuepos_ - the position.key_ - the associated key.element_ - the element to be put in the queue.
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 interface QueuepreviousElement_ - the previous element.element_ - the element to be put in the queue.
previousElement_ does not appear.public void merge(Queue that_)
Queuethat_ by the order of
that_.dequeue().
merge in interface Queuepublic void enqueue(java.lang.Object element_)
Queue
enqueue in interface Queuepublic abstract java.lang.Object dequeue()
Queue
dequeue in interface Queuepublic abstract java.lang.Object dequeue(double key_)
Queue
dequeue in interface Queuepublic abstract java.lang.Object remove(java.lang.Object element_)
Queueequals() the argument.
remove in interface Queue
public abstract java.lang.Object remove(double key_,
java.lang.Object element_)
Queueequals()
the argument.
remove in interface Queuepublic abstract void removeAll(java.lang.Object element_)
Queueequals() the argument.
removeAll in interface Queue
public abstract void removeAll(double key_,
java.lang.Object element_)
Queue
removeAll in interface Queuepublic abstract java.lang.Object remove(int n_)
Queue
remove in interface Queuepublic abstract java.lang.Object firstElement()
Queue
firstElement in interface Queuepublic abstract double firstKey()
Queuejava.lang.Double.NaN if the queue is empty.
firstKey in interface Queuepublic abstract java.lang.Object lastElement()
Queue
lastElement in interface Queuepublic abstract double lastKey()
Queuejava.lang.Double.NaN if the queue is empty.
lastKey in interface Queuepublic abstract java.lang.Object retrieveAt(int n_)
Queue
retrieveAt in interface Queuepublic abstract double retrieveKeyAt(int n_)
Queue
retrieveKeyAt in interface Queuepublic abstract java.lang.Object retrieveBy(double key_)
Queue
retrieveBy in interface Queuenull if no match is found.public abstract java.lang.Object[] retrieveAll(double key_)
Queue
retrieveAll in interface Queuepublic abstract java.lang.Object[] retrieveAll()
Queue
retrieveAll in interface Queuepublic abstract Element[] _retrieveAll()
Queue
_retrieveAll in interface Queuepublic abstract double retrieveKey(java.lang.Object o_)
Queue
retrieveKey in interface Queuepublic abstract boolean contains(java.lang.Object element_)
Queue
contains in interface Queuepublic abstract boolean containsKey(double key_)
Queue
containsKey in interface Queuepublic abstract double[] keys()
Queue
keys in interface Queuepublic abstract java.util.Enumeration getKeyEnumerator()
getKeyEnumerator in interface Queuepublic abstract java.util.Enumeration getElementEnumerator()
getElementEnumerator in interface Queuepublic abstract int getLength()
Queue
getLength in interface Queue
public java.lang.String info(java.lang.String prefix_,
boolean listElement_)
Queue
info in interface Queueprefix_ - prefix of each line when printing.public java.lang.String info()
Queue
info in interface Queuepublic java.lang.String info(java.lang.String prefix_)
Queue
info in interface Queuepublic abstract java.lang.String oneline()
Queue
oneline in interface Queuepublic java.lang.String diag(boolean listElement_)
info().
diag in interface Queuepublic void duplicate(java.lang.Object source_)
DrclObjsource_ object to this object.
he subclass must implement this method to realize DrclObj.clone().
duplicate in interface ObjectDuplicableduplicate in class DrclObj
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||