|
||||||||||
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. |
java.lang.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 java.io.IOException
aProvider
- Storage provider used for backing this buffer.attributeMapSerializer
- Attribute map serializer to be used.
java.io.IOException
protected 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 java.io.IOException
Notice that a call to this method does not affect the current position events are read from.
ate
- The event to append
java.io.IOException
public boolean replace(XEvent event, int index) throws java.io.IOException
event
- The new event to be inserted.index
- Index to replace at.
java.io.IOException
public XEvent get(int eventIndex) throws java.io.IOException, java.lang.IndexOutOfBoundsException
eventIndex
- Position of the requested event, defined to be within
[0, size()-1]
.
java.io.IOException
java.lang.IndexOutOfBoundsException
public void cleanup() throws java.io.IOException
java.io.IOException
protected void navigateToIndex(int reqIndex) throws java.io.IOException
reqIndex
- Index to position the file pointer to.
java.io.IOException
protected void resetPosition()
protected void skipForward(int eventsToSkip) throws java.io.IOException
eventsToSkip
- Number of records to be skipped.
java.io.IOException
protected void skipBackward(int eventsToSkip) throws java.io.IOException
eventsToSkip
- Number of records to be skipped.
java.io.IOException
protected XEvent read() throws java.io.IOException
java.io.IOException
protected byte[] encode(XEvent event) throws java.io.IOException
ate
- The event to be encoded.
java.io.IOException
public java.lang.Object clone()
clone
in class java.lang.Object
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |