Package org.deckfour.xes.model.buffered
Class XTraceBufferedImpl
- java.lang.Object
-
- org.deckfour.xes.model.buffered.XTraceBufferedImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<XEvent>,java.util.Collection<XEvent>,java.util.List<XEvent>,XAttributable,XElement,XTrace
public class XTraceBufferedImpl extends java.lang.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
Fields Modifier and Type Field Description static java.lang.StringID_PREFIXID prefix used for this implementation.
-
Constructor Summary
Constructors Constructor Description XTraceBufferedImpl(XAttributeMap attributeMap, XAttributeMapSerializer attributeMapSerializer)Creates a new trace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(XVisitor visitor, XLog log)voidadd(int index, XEvent event)booleanadd(XEvent event)booleanaddAll(int index, java.util.Collection<? extends XEvent> c)booleanaddAll(java.util.Collection<? extends XEvent> c)voidclear()java.lang.Objectclone()Creates an identical clone of this trace.booleanconsolidate()Trigger consolidation of this trace.booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)List equality for XTrace Equality as defined in the List interface and as implemented in the AbstractList class, with a small tweak for efficiency.protected voidfinalize()XEventget(int index)XAttributeMapgetAttributes()Retrieves the attributes set for this element.java.util.Set<XExtension>getExtensions()Retrieves the extensions used by this element, i.e.booleanhasAttributes()Checks for the existence of attributes.intindexOf(java.lang.Object o)intinsertOrdered(XEvent event)Insert the event in an ordered manner, if timestamp information is available in this trace.booleanisEmpty()java.util.Iterator<XEvent>iterator()intlastIndexOf(java.lang.Object o)java.util.ListIterator<XEvent>listIterator()java.util.ListIterator<XEvent>listIterator(int index)XEventremove(int index)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)XEventset(int index, XEvent event)voidsetAttributes(XAttributeMap attributes)Sets the map of attributes for this element.intsize()java.util.List<XEvent>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] a)
-
-
-
Field Detail
-
ID_PREFIX
public static final java.lang.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
-
equals
public boolean equals(java.lang.Object o)
List equality for XTrace Equality as defined in the List interface and as implemented in the AbstractList class, with a small tweak for efficiency.- Specified by:
equalsin interfacejava.util.Collection<XEvent>- Specified by:
equalsin interfacejava.util.List<XEvent>- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Object to be compared with this XTrace implementation.- Returns:
- Returns true if both objects are lists and the elements of both lists are equal.
-
getAttributes
public XAttributeMap getAttributes()
Description copied from interface:XAttributableRetrieves the attributes set for this element.- Specified by:
getAttributesin interfaceXAttributable- Returns:
- A map of attributes.
-
hasAttributes
public boolean hasAttributes()
Description copied from interface:XAttributableChecks for the existence of attributes. This method can be a more efficient way of checking for the existance of attributes than usingXAttributable.getAttributes()in certain situations.- Specified by:
hasAttributesin interfaceXAttributable- Returns:
- whether this element has any attributes
-
getExtensions
public java.util.Set<XExtension> getExtensions()
Description copied from interface:XAttributableRetrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.- Specified by:
getExtensionsin interfaceXAttributable- Returns:
- A set of extensions.
-
setAttributes
public void setAttributes(XAttributeMap attributes)
Description copied from interface:XAttributableSets the map of attributes for this element.- Specified by:
setAttributesin interfaceXAttributable- Parameters:
attributes- A map of attributes.
-
add
public boolean add(XEvent event)
-
addAll
public boolean addAll(java.util.Collection<? extends XEvent> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends XEvent> c)- Specified by:
addAllin interfacejava.util.List<XEvent>
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOfin interfacejava.util.List<XEvent>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<XEvent> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<XEvent>
-
listIterator
public java.util.ListIterator<XEvent> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<XEvent>
-
listIterator
public java.util.ListIterator<XEvent> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<XEvent>
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
set
public XEvent set(int index, XEvent event)
- Specified by:
setin interfacejava.util.List<XEvent>
-
size
public int size()
-
subList
public java.util.List<XEvent> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<XEvent>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
clone
public java.lang.Object clone()
Creates an identical clone of this trace.
-
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.- Specified by:
insertOrderedin interfaceXTrace- Parameters:
event- the event to be inserted.- Returns:
- index of the inserted event.
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-