|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.nist.antd.diffserv.SimplePacketQueue
Simple packet queue provides the basic fifoQueue(LinkedList) to implement various packet queue (e.g. DropTail, RED, RIO).
This class was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
| Field Summary | |
(package private) java.util.LinkedList |
fifoQueue
The queue itself. |
private int |
maxSize
The maximumsize of the queue. |
private int |
qlength
The length of the queue. |
| Constructor Summary | |
SimplePacketQueue()
Constructs the simplequeue. |
|
| Method Summary | |
MessageWrapper |
dequeue()
Retunr the first element in the queue and delete it out of the queue. |
boolean |
enqueue(ProtocolMessage message,
ProtocolSession fromSession)
Add the given message to the queue. |
int |
getAvailableQLength()
Returns the available length of the queue. |
MessageWrapper |
getFirstPacket()
Returns the first wrapper packet in the queue. |
int |
getMaxSize()
Returns the maximum size of the queue. |
int |
getQLength()
Return the length of the queue. |
void |
init(int maxSize)
Initializes the queue. |
boolean |
isEmpty()
Returns if the queue is empty or not. |
boolean |
isFull(int size)
Determines if the kapacity of the queue can take a package withthe given size. |
void |
reset()
Method reset - not implemented yet. |
void |
setMaxSize(int newMaxSize)
Set the maximum size of the queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int maxSize
private int qlength
java.util.LinkedList fifoQueue
| Constructor Detail |
public SimplePacketQueue()
| Method Detail |
public void init(int maxSize)
maxSize - The new maximum size of the queue.public void reset()
public boolean isEmpty()
public boolean isFull(int size)
size - The size of the next package
public int getQLength()
public int getMaxSize()
public int getAvailableQLength()
public void setMaxSize(int newMaxSize)
newMaxSize - The maximum size of the queue.
public boolean enqueue(ProtocolMessage message,
ProtocolSession fromSession)
message - The message that has to be stored in the queue.fromSession - The session the message comes from.
public MessageWrapper dequeue()
public MessageWrapper getFirstPacket()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||