Package org.deckfour.xes.classification
Class XEventClasses
- java.lang.Object
-
- org.deckfour.xes.classification.XEventClasses
-
public class XEventClasses extends java.lang.ObjectA set of event classes. For any log, this class can be used to impose a classification of events. Two events which belong to the same event class can be considered equal, i.e. to refer to the same higher-level concept they represent (e.g., an activity). Event classes are imposed on a log by a specific classifier. This class can be configured with such a classifier, which is then used to derive the actual event classes from a log, by determining the identity of the contained events.- Author:
- Christian W. Guenther (christian@deckfour.org)
-
-
Field Summary
Fields Modifier and Type Field Description protected XEventClassifierclassifierThe classifier used for creating the set of event classes.protected java.util.HashMap<java.lang.String,XEventClass>classMapMap holding the event classes, indexed by their unique identifier string.
-
Constructor Summary
Constructors Constructor Description XEventClasses(XEventClassifier classifier)Creates a new instance, i.e.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XEventClassesderiveEventClasses(XEventClassifier classifier, XLog log)Creates a new set of event classes, factory method.booleanequals(java.lang.Object o)Equality of event classes is based on their classifier, i.e., if two event classes have the same classifier, they are considered as equal in terms of this method.XEventClassgetByIdentity(java.lang.String classIdentity)Returns a given event class by its identity, i.e.XEventClassgetByIndex(int index)Returns a given event class by its unique index.java.util.Collection<XEventClass>getClasses()Returns the collection of event classes contained in this instance.XEventClassifiergetClassifier()Returns the classifier used for determining event classes.XEventClassgetClassOf(XEvent event)For any given event, returns the corresponding event class as determined by this set.voidharmonizeIndices()This method harmonizeds the indices of all contained event classes.voidregister(java.lang.String classId)Registers an event class with this set of event classes.voidregister(XEvent event)Registers an event with this set of event classes.voidregister(XLog log)Registers a log with this set of event classes.voidregister(XTrace trace)Registers a trace with this set of event classes.intsize()Returns the size of this set of event classes.java.lang.StringtoString()
-
-
-
Field Detail
-
classifier
protected XEventClassifier classifier
The classifier used for creating the set of event classes.
-
classMap
protected java.util.HashMap<java.lang.String,XEventClass> classMap
Map holding the event classes, indexed by their unique identifier string.
-
-
Constructor Detail
-
XEventClasses
public XEventClasses(XEventClassifier classifier)
Creates a new instance, i.e. an empty set of event classes.- Parameters:
classifier- The classifier used for event comparison.
-
-
Method Detail
-
deriveEventClasses
public static XEventClasses deriveEventClasses(XEventClassifier classifier, XLog log)
Creates a new set of event classes, factory method.- Parameters:
classifier- The classifier to be used for event comparison.log- The log, on which event classes should be imposed.- Returns:
- A set of event classes, as an instance of this class.
-
getClassifier
public XEventClassifier getClassifier()
Returns the classifier used for determining event classes.- Returns:
- A classifier used in this set of classes.
-
getClasses
public java.util.Collection<XEventClass> getClasses()
Returns the collection of event classes contained in this instance.- Returns:
- A collection of event classes.
-
size
public int size()
Returns the size of this set of event classes.- Returns:
- The number of event classes contained in this set.
-
getClassOf
public XEventClass getClassOf(XEvent event)
For any given event, returns the corresponding event class as determined by this set.- Parameters:
event- The event of which the event class should be determined.- Returns:
- The event class of this event, as found in this set of event
classes. If no matching event class is found, this method may
return
null.
-
getByIdentity
public XEventClass getByIdentity(java.lang.String classIdentity)
Returns a given event class by its identity, i.e. its unique identifier string.- Parameters:
classIdentity- Identifier string of the requested event class.- Returns:
- The requested event class. If no matching event class is found,
this method may return
null.
-
getByIndex
public XEventClass getByIndex(int index)
Returns a given event class by its unique index.- Parameters:
index- Unique index of the requested event class.- Returns:
- The requested event class. If no matching event class is found,
this method may return
null.
-
register
public void register(XLog log)
Registers a log with this set of event classes. This will result in all events of this log being analyzed, and potentially new event classes being added to this set of event classes. Event classes will be incremented in size, as new members of these classes are found among the events in the log.- Parameters:
log- The log to be analyzed.
-
register
public void register(XTrace trace)
Registers a trace with this set of event classes. This will result in all events of this trace being analyzed, and potentially new event classes being added to this set of event classes. Event classes will be incremented in size, as new members of these classes are found among the events in the trace.- Parameters:
trace- The trace to be analyzed.
-
register
public void register(XEvent event)
Registers an event with this set of event classes. This will potentially add a new event class to this set of event classes. An event class will be incremented in size, if the given event is found to be a member of it.- Parameters:
event- The event to be analyzed.
-
register
public void register(java.lang.String classId)
Registers an event class with this set of event classes. This will potentially add a new event class to this set of event classes. An event class will be incremented in size, if the given event is found to be a member of it.- Parameters:
classId- The event class to be analyzed.
-
harmonizeIndices
public void harmonizeIndices()
This method harmonizeds the indices of all contained event classes. Indices are re-assigned according to the natural order of class identities, i.e., the alphabetical order of class identity strings. This method should be called after the composition or derivation of event classes is complete, e.g., after scanning a log for generating the log info. Using parties should not have to worry about event class harmonization, and can thus safely ignore this method.
-
equals
public boolean equals(java.lang.Object o)
Equality of event classes is based on their classifier, i.e., if two event classes have the same classifier, they are considered as equal in terms of this method.- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-