udt.util
Class CircularArray<T>
java.lang.Object
udt.util.CircularArray<T>
- Direct Known Subclasses:
- AckHistoryWindow, PacketHistoryWindow, PacketPairWindow
public class CircularArray<T>
- extends Object
Circular array: the most recent value overwrites the oldest one if there is no more free
space in the array
|
Constructor Summary |
CircularArray(int size)
Create a new circularArray of the given size |
|
Method Summary |
void |
add(T entry)
add an entry |
int |
size()
Returns the number of elements in this list |
String |
toString()
|
position
protected int position
haveOverflow
protected boolean haveOverflow
max
protected final int max
circularArray
protected final List<T> circularArray
CircularArray
public CircularArray(int size)
- Create a new circularArray of the given size
- Parameters:
size -
add
public void add(T entry)
- add an entry
size
public int size()
- Returns the number of elements in this list
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2013 LittleShoot. All Rights Reserved.