|
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.comp.Component
drcl.comp.queue.ActiveQueue
An ActiveQueue is a queue and it is
designed to interact with a data pulling component.
It accepts a null signal from the data pulling component
which triggers a dequeue and the dequeued data is sent at the output@
port. If the queue is empty, this component remembers that the pulling component is
available for more data, and when new data arrives, this component actively
sends out the data at the output@ port without the pulling component
to do the pulling again.
| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary | |
protected int |
nrequests
|
protected Port |
outport
|
static java.lang.String |
OUTPUT_PORT_ID
|
| Constructor Summary | |
ActiveQueue()
|
|
ActiveQueue(java.lang.String id_)
|
|
| Method Summary | |
protected int |
_getnrequests()
|
protected void |
_setnrequests(int nreq_)
|
abstract java.lang.Object |
dequeue()
Dequeues and returns the first object in the queue. |
abstract java.lang.Object |
enqueue(java.lang.Object obj_)
Enqueues the object at the end of the queue |
java.lang.Object |
enqueueAt(java.lang.Object obj_,
int pos_)
Enqueues the object at the position specified. |
java.lang.Object |
firstElement()
Retrieves but not dequeue the first object in the queue. |
int |
getAvailableSize()
Returns the available size of the queue. |
abstract int |
getCapacity()
Returns the capacity of the queue. |
protected long |
getEnqueCount()
|
abstract int |
getSize()
Returns the current size of the queue. |
void |
increaseEnqueCount()
Increases the enqueue counter, for diagnosis purpose. |
java.lang.String |
info()
Returns information regarding this component. |
java.lang.String |
info(java.lang.String prefix_)
|
abstract boolean |
isEmpty()
Return true if the queue is empty. |
abstract boolean |
isFull()
Return true if the queue is full. |
java.lang.Object |
lastElement()
Retrieves but not remove the last object in the queue. |
java.lang.Object |
peekAt(int pos_)
Retrieves but not dequeue the object at the position specified. |
protected void |
process(java.lang.Object data_,
Port inPort_)
The main callback method of a component. |
protected java.lang.Object |
pull()
Returns the first available data in the queue. |
void |
reset()
Resets the component for being used anew. |
java.lang.Object |
retrieveAt(int pos_)
Dequeues the object at the position specified. |
abstract void |
setCapacity(int capacity_)
Sets the capacity of the queue. |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String OUTPUT_PORT_ID
protected int nrequests
protected Port outport
| Constructor Detail |
public ActiveQueue()
public ActiveQueue(java.lang.String id_)
| Method Detail |
public void reset()
Component
reset in class Componentpublic java.lang.String info()
Component
info in class Componentpublic java.lang.String info(java.lang.String prefix_)
protected void process(java.lang.Object data_,
Port inPort_)
Component
process in class Componentdata_ - the arrival data.inPort_ - the port where the data arrives.protected final long getEnqueCount()
public final void increaseEnqueCount()
public abstract java.lang.Object enqueue(java.lang.Object obj_)
public java.lang.Object enqueueAt(java.lang.Object obj_,
int pos_)
public abstract java.lang.Object dequeue()
public java.lang.Object retrieveAt(int pos_)
public java.lang.Object peekAt(int pos_)
public java.lang.Object firstElement()
public java.lang.Object lastElement()
public abstract boolean isFull()
public abstract boolean isEmpty()
public abstract void setCapacity(int capacity_)
public abstract int getCapacity()
public abstract int getSize()
public int getAvailableSize()
protected final void _setnrequests(int nreq_)
protected final int _getnrequests()
protected final java.lang.Object pull()
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||