|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.Vector
verinec.netsim.util.tables.SlidingWindowPacketBuffer
public class SlidingWindowPacketBuffer
A sliding window buffer containing packets
| Field Summary | |
|---|---|
private int |
ack
|
private int |
capacity
|
private Logger |
jlogger
|
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
SlidingWindowPacketBuffer(int initialCapacity)
Creates a new sliding window buffer. |
|
| Method Summary | |
|---|---|
private void |
cleanUp()
|
TCPPacket |
get()
gets the first packet from the contiguous part of the window |
int |
getAck()
gets the address of the last packet of the buffer that can be acknowledged |
private int |
getNextSeq(int seq)
|
private TCPPacket |
getPacket(int seq)
gets packet from the contiguous part of the window |
private int |
getSmallestSeq()
|
int |
put(TCPPacket packet)
writes a TCP Packet into the buffer |
void |
removePacket()
removes the packet with the smallest sequence number |
void |
removePacket(int seq)
removes a packet with a given sequence number from the buffer |
private void |
updateAck()
|
int |
windowsize()
gets the remaining window size |
| Methods inherited from class java.util.Vector |
|---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Field Detail |
|---|
private int capacity
private int ack
private Logger jlogger
| Constructor Detail |
|---|
public SlidingWindowPacketBuffer(int initialCapacity)
initialCapacity - the window size (capacity of the buffer)| Method Detail |
|---|
public int put(TCPPacket packet)
throws NetSimException
packet - a TCP Packet
NetSimException - if there if no more spave left in buffer or the address is
out of window rangeprivate void cleanUp()
public int getAck()
private void updateAck()
private TCPPacket getPacket(int seq)
throws NetSimException
seq - the packets sequence number
NetSimException - if requested packet not in buffer or separated by missing
partprivate int getSmallestSeq()
private int getNextSeq(int seq)
throws NetSimException
NetSimException
public TCPPacket get()
throws NetSimException
NetSimException - if requested element not in buffer or separated by missing
partpublic void removePacket()
public void removePacket(int seq)
seq - a sequence numberpublic int windowsize()
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||