|
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
| Constructor Summary | |
Queue()
|
|
| 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 time 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 boolean |
enqueue(double key_,
java.lang.Object element_)
Enqueues the element with the associated key. |
abstract boolean |
enqueue(double key_,
java.lang.Object element_,
int size_)
Enqueues the element with the associated key. |
abstract boolean |
enqueue(java.lang.Object element_)
Associates the element with the largest key in the queue and then enqueues the element. |
abstract boolean |
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_)
Enqueues the element right after the previousElement_ element and
associates the element with a key equal to the previous element's. |
abstract 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_)
Enqueues the element at the position specified with the associated key. |
abstract boolean |
enqueueAt(int pos_,
double key_,
java.lang.Object element_,
int size_)
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. |
int |
getAvailableSize()
Returns the vacancy of the queue. |
abstract java.util.Enumeration |
getElementEnumerator()
|
abstract java.util.Enumeration |
getKeyEnumerator()
|
abstract int |
getLength()
Returns the current length of the queue. |
abstract int |
getMaxSize()
Returns the maximum size of the queue. |
abstract 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. |
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. |
boolean |
isFull()
Returns true if the queue is full. |
boolean |
isFull(int size_)
Returns true if the queue will be overflowed by an object of the size. |
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. |
boolean |
merge(Queue that_)
Enqueues the elements in the queue 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 time 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 size of the queue is smaller than (n+1). |
abstract void |
setMaxSize(int size_,
boolean truncate_)
Sets the maximum size of the queue. |
| 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 Queue()
| Method Detail |
public abstract void reset()
public boolean isEmpty()
public boolean isFull()
public boolean isFull(int size_)
public abstract boolean enqueue(double key_,
java.lang.Object element_)
key_ - the associated key.element_ - the element to be put in the queue.
public boolean enqueueAt(int pos_,
double key_,
java.lang.Object element_)
pos_ - 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_)
previousElement_ element and
associates the element with a key equal to the previous element's.previousElement_ - the previous element.element_ - the element to be put in the queue.previousElement_ does not appear or the queue is full.
public abstract boolean enqueue(double key_,
java.lang.Object element_,
int size_)
key_ - the associated key.element_ - the element to be put in the queue.size_ - size of the element.
public abstract boolean enqueueAt(int pos_,
double key_,
java.lang.Object element_,
int size_)
pos_ - the position.key_ - the associated key.element_ - the element to be put in the queue.size_ - size of the element.
public abstract boolean enqueueAfter(java.lang.Object previousElement_,
java.lang.Object element_,
int size_)
previousElement_ element and
associates the element with a key equal to the previous element's.previousElement_ - 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 merge(Queue that_)
that_ by the order of
that_.dequeue().that_ are successfully enqueued.public abstract boolean enqueue(java.lang.Object element_)
public abstract boolean enqueue(java.lang.Object element_,
int size_)
size_ - size of the element.public abstract java.lang.Object dequeue()
public abstract java.lang.Object dequeue(double key_)
public abstract java.lang.Object remove(java.lang.Object element_)
equals() the argument.
public abstract java.lang.Object remove(double key_,
java.lang.Object element_)
equals() the argument.public abstract void removeAll(java.lang.Object element_)
equals() the argument.
public abstract void removeAll(double key_,
java.lang.Object element_)
public abstract java.lang.Object remove(int n_)
public abstract java.lang.Object firstElement()
public abstract double firstKey()
java.lang.Double.NaN if the queue is empty.public abstract java.lang.Object lastElement()
public abstract double lastKey()
java.lang.Double.NaN if the queue is empty.public abstract java.lang.Object retrieveAt(int n_)
public abstract double retrieveKeyAt(int n_)
public abstract java.lang.Object retrieveBy(double key_)
public abstract java.lang.Object[] retrieveAll(double key_)
public abstract java.lang.Object[] retrieveAll()
public abstract Element[] _retrieveAll()
public abstract double retrieveKey(java.lang.Object o_)
public abstract boolean contains(java.lang.Object element_)
public abstract boolean containsKey(double key_)
public abstract double[] keys()
public abstract java.util.Enumeration getKeyEnumerator()
public abstract java.util.Enumeration getElementEnumerator()
public abstract int getSize()
public abstract int getLength()
public abstract int getMaxSize()
public int getAvailableSize()
public abstract void setMaxSize(int size_,
boolean truncate_)
truncate_ is set,
then the size_th element, and the elements after,
are removed from the queue.
public java.lang.String info(java.lang.String prefix_,
boolean listElement_)
prefix_ - prefix of each line when printing.public java.lang.String info()
public java.lang.String info(java.lang.String prefix_)
public abstract java.lang.String oneline()
public java.lang.String diag(boolean listElement_)
info().public void duplicate(java.lang.Object source_)
DrclObjsource_ object to this object.
he subclass must implement this method to realize DrclObj.clone().duplicate in class DrclObj
|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||