org.deckfour.xes.model.buffered
Class XTraceBufferedImpl

java.lang.Object
  extended by org.deckfour.xes.model.buffered.XTraceBufferedImpl
All Implemented Interfaces:
Cloneable, Iterable<XEvent>, Collection<XEvent>, List<XEvent>, XAttributable, XElement, XTrace

public class XTraceBufferedImpl
extends Object
implements XTrace

Soft-buffered implementation of the XTrace interface. Uses the virtual NikeFS filesystem for event log data for transparently storing the data on disk, so that main memory is freed for other tasks.

Author:
Christian W. Guenther (christian@deckfour.org)

Field Summary
static String ID_PREFIX
          ID prefix used for this implementation.
 
Constructor Summary
XTraceBufferedImpl(XAttributeMap attributeMap, XAttributeMapSerializer attributeMapSerializer)
          Creates a new trace.
 
Method Summary
 void add(int index, XEvent event)
           
 boolean add(XEvent event)
           
 boolean addAll(Collection<? extends XEvent> c)
           
 boolean addAll(int index, Collection<? extends XEvent> c)
           
 void clear()
           
 Object clone()
          Creates an identical clone of this trace.
 boolean consolidate()
          Trigger consolidation of this trace.
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
protected  void finalize()
           
 XEvent get(int index)
           
 XAttributeMap getAttributes()
          Retrieves the attributes set for this element.
 Set<XExtension> getExtensions()
          Retrieves the extensions used by this element, i.e.
 int indexOf(Object o)
           
 int insertOrdered(XEvent event)
          Insert the event in an ordered manner, if timestamp information is available in this trace.
 boolean isEmpty()
           
 Iterator<XEvent> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<XEvent> listIterator()
           
 ListIterator<XEvent> listIterator(int index)
           
 XEvent remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 XEvent set(int index, XEvent event)
           
 void setAttributes(XAttributeMap attributes)
          Sets the map of attributes for this element.
 int size()
           
 List<XEvent> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Field Detail

ID_PREFIX

public static final String ID_PREFIX
ID prefix used for this implementation.

See Also:
Constant Field Values
Constructor Detail

XTraceBufferedImpl

public XTraceBufferedImpl(XAttributeMap attributeMap,
                          XAttributeMapSerializer attributeMapSerializer)
Creates a new trace.

Parameters:
attributeMap - Map to store the attributes of this trace.
attributeMapSerializer - Serializer used to serialize the attribute maps of events in this buffered trace.
Method Detail

getAttributes

public XAttributeMap getAttributes()
Description copied from interface: XAttributable
Retrieves the attributes set for this element.

Specified by:
getAttributes in interface XAttributable
Returns:
A map of attributes.

getExtensions

public Set<XExtension> getExtensions()
Description copied from interface: XAttributable
Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.

Specified by:
getExtensions in interface XAttributable
Returns:
A set of extensions.

setAttributes

public void setAttributes(XAttributeMap attributes)
Description copied from interface: XAttributable
Sets the map of attributes for this element.

Specified by:
setAttributes in interface XAttributable
Parameters:
attributes - A map of attributes.

add

public boolean add(XEvent event)
Specified by:
add in interface Collection<XEvent>
Specified by:
add in interface List<XEvent>

add

public void add(int index,
                XEvent event)
Specified by:
add in interface List<XEvent>

addAll

public boolean addAll(Collection<? extends XEvent> c)
Specified by:
addAll in interface Collection<XEvent>
Specified by:
addAll in interface List<XEvent>

addAll

public boolean addAll(int index,
                      Collection<? extends XEvent> c)
Specified by:
addAll in interface List<XEvent>

clear

public void clear()
Specified by:
clear in interface Collection<XEvent>
Specified by:
clear in interface List<XEvent>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<XEvent>
Specified by:
contains in interface List<XEvent>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<XEvent>
Specified by:
containsAll in interface List<XEvent>

get

public XEvent get(int index)
Specified by:
get in interface List<XEvent>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<XEvent>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<XEvent>
Specified by:
isEmpty in interface List<XEvent>

iterator

public Iterator<XEvent> iterator()
Specified by:
iterator in interface Iterable<XEvent>
Specified by:
iterator in interface Collection<XEvent>
Specified by:
iterator in interface List<XEvent>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<XEvent>

listIterator

public ListIterator<XEvent> listIterator()
Specified by:
listIterator in interface List<XEvent>

listIterator

public ListIterator<XEvent> listIterator(int index)
Specified by:
listIterator in interface List<XEvent>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<XEvent>
Specified by:
remove in interface List<XEvent>

remove

public XEvent remove(int index)
Specified by:
remove in interface List<XEvent>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<XEvent>
Specified by:
removeAll in interface List<XEvent>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<XEvent>
Specified by:
retainAll in interface List<XEvent>

set

public XEvent set(int index,
                  XEvent event)
Specified by:
set in interface List<XEvent>

size

public int size()
Specified by:
size in interface Collection<XEvent>
Specified by:
size in interface List<XEvent>

subList

public List<XEvent> subList(int fromIndex,
                            int toIndex)
Specified by:
subList in interface List<XEvent>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<XEvent>
Specified by:
toArray in interface List<XEvent>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<XEvent>
Specified by:
toArray in interface List<XEvent>

clone

public Object clone()
Creates an identical clone of this trace.

Specified by:
clone in interface XElement
Overrides:
clone in class Object
Returns:
An identical clone.

consolidate

public boolean consolidate()
Trigger consolidation of this trace.

Returns:
whether consolidation has been performed.

insertOrdered

public int insertOrdered(XEvent event)
Insert the event in an ordered manner, if timestamp information is available in this trace.

Parameters:
event - the event to be inserted.
Returns:
index of the inserted event.

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable