|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.util.QSWindow
The QSWindow
object is a data structure similiar to
a queue. It can store up to a fixed amount of
QuickSerializable
objects, and once it contains that
many objects, it begins overwriting the least recent object
added to it. In this way, it represents a kind of window of
objects in time that it can hold.
There is probably a lot of functionality that can be added to this object to make it more useful. Please feel free to add to it as necessary.
Field Summary | |
---|---|
static int |
DEFAULT_SIZE
|
Constructor Summary | |
---|---|
QSWindow()
Construct a QSWindow with a default maximum capacity.
|
|
QSWindow(InputBuffer buffer)
Constructs a QSWindow from its
QuickSerializable form. |
|
QSWindow(int windowSize)
Construct a QSWindow object with the given maximum
capacity. |
Method Summary | |
---|---|
void |
add(QuickSerializable datum)
Add this object to the window. |
void |
clear()
Forget about all elements currently in the window. |
void |
clear(int num)
Forget about a certain number of the least-recently added data. |
void |
serialize(OutputBuffer buffer)
Specified by the QuickSerializable interface. |
QuickSerializable[] |
toArray()
Convert the elements in this window to an array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_SIZE
Constructor Detail |
public QSWindow(int windowSize)
QSWindow
object with the given maximum
capacity.
windowSize
- the maximum capacity of this windowpublic QSWindow()
QSWindow
with a default maximum capacity.
Currently this default is 1000.
public QSWindow(InputBuffer buffer) throws QSException
QSWindow
from its
QuickSerializable
form.
Method Detail |
public void serialize(OutputBuffer buffer)
QuickSerializable
interface.
serialize
in interface QuickSerializable
buffer
- the output buffer to add the object topublic void add(QuickSerializable datum)
datum
- the object to addpublic void clear(int num)
num
- the number of elements to forgetpublic void clear()
public QuickSerializable[] toArray()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |