|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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(byte[] data,
int[] offset)
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 |
to_bytes(byte[] data,
int[] offset)
Specified by the QuickSerializable interface. |
QuickSerializable[] |
toArray()
Convert the elements in this window to an array. |
int |
type_code()
Specified by the QuickSerializable interface. |
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(byte[] data, int[] offset) throws QSException
QSWindow
from its
QuickSerializable
form.Method Detail |
public void to_bytes(byte[] data, int[] offset)
QuickSerializable
interface.to_bytes
in interface QuickSerializable
ostore.util.QuickSerializable
data
- The byte array to store into, or null
.offset
- A single element array whose first
element is the index in data to begin writing at on
function entry, and which on function exit has been
incremented by the number of bytes written.public int type_code()
QuickSerializable
interface.type_code
in interface QuickSerializable
ostore.util.QuickSerializable
public 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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |