|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deckfour.xes.model.buffered.XSequentialEventBuffer
public class XSequentialEventBuffer
This class provides a random-access interface to a sequential set of events. These events are buffered not in heap space, but in a binary buffer file, whose encoding is implemented in this class as well.
The structure of a buffer file is a sequence of binary records, one for each events, where records are encoded as follows:
| Field Summary | |
|---|---|
protected static int |
EXTENSION_GENERIC
Encoding for non-existent extension (generic attributes) |
| Constructor Summary | |
|---|---|
protected |
XSequentialEventBuffer()
|
|
XSequentialEventBuffer(NikeFS2StorageProvider aProvider,
XAttributeMapSerializer attributeMapSerializer)
Creates and initializes a new instance of this class. |
| Method Summary | |
|---|---|
void |
append(XEvent event)
Appends a new event to the end of this collection. |
void |
cleanup()
Cleans up any non-volatile resources (e.g. |
Object |
clone()
Creates an identical clone of this buffer. |
protected byte[] |
encode(XEvent event)
Encodes the given event into a sequence of bytes. |
protected void |
finalize()
Remove buffer file when this instance is garbage collected. |
XEvent |
get(int eventIndex)
Retrieves the event recorded at the specified position |
NikeFS2StorageProvider |
getProvider()
Returns the storage provider used by this instance |
NikeFS2RandomAccessStorage |
getStorage()
Returns the random access storage this instance is based on |
int |
index()
Retrieves the current internal, logical position of this collection. |
long |
lastInsert()
Returns the last insert position of this instance |
protected void |
navigateToIndex(int reqIndex)
Repositions the low-level layer to read from the specified index. |
long |
position()
Returns the current position of this instance |
protected XEvent |
read()
Reads an event from the current position of the data access layer. |
boolean |
replace(XEvent event,
int index)
Replaces an event at the given position. |
protected void |
resetPosition()
Resets the position of the data access layer to read the next event from the first position. |
int |
size()
Retrieves the number of events recorded in this instance. |
protected void |
skipBackward(int eventsToSkip)
Repositions the position of the data access layer to skip the specified number of records towards the beginning of the file. |
protected void |
skipForward(int eventsToSkip)
Repositions the position of the data access layer to skip the specified number of records towards the end of the file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int EXTENSION_GENERIC
| Constructor Detail |
|---|
public XSequentialEventBuffer(NikeFS2StorageProvider aProvider,
XAttributeMapSerializer attributeMapSerializer)
throws IOException
aProvider - Storage provider used for backing this buffer.attributeMapSerializer - Attribute map serializer to be used.
IOExceptionprotected XSequentialEventBuffer()
| Method Detail |
|---|
public NikeFS2StorageProvider getProvider()
public long position()
public long lastInsert()
public NikeFS2RandomAccessStorage getStorage()
public int size()
public int index()
public void append(XEvent event)
throws IOException
Notice that a call to this method does not affect the current position events are read from.
ate - The event to append
IOException
public boolean replace(XEvent event,
int index)
throws IOException
event - The new event to be inserted.index - Index to replace at.
IOException
public XEvent get(int eventIndex)
throws IOException,
IndexOutOfBoundsException
eventIndex - Position of the requested event, defined
to be within [0, size()-1].
IOException
IndexOutOfBoundsException
public void cleanup()
throws IOException
IOException
protected void navigateToIndex(int reqIndex)
throws IOException
reqIndex - Index to position the file pointer to.
IOExceptionprotected void resetPosition()
protected void skipForward(int eventsToSkip)
throws IOException
eventsToSkip - Number of records to be skipped.
IOException
protected void skipBackward(int eventsToSkip)
throws IOException
eventsToSkip - Number of records to be skipped.
IOException
protected XEvent read()
throws IOException
IOException
protected byte[] encode(XEvent event)
throws IOException
ate - The event to be encoded.
IOExceptionpublic Object clone()
clone in class Object
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||