org.deckfour.xes.classification
Class XEventClasses

java.lang.Object
  extended by org.deckfour.xes.classification.XEventClasses

public class XEventClasses
extends Object

A 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
protected  XEventClassifier classifier
          The classifier used for creating the set of event classes.
protected  HashMap<String,XEventClass> classMap
          Map holding the event classes, indexed by their unique identifier string.
 
Constructor Summary
XEventClasses(XEventClassifier classifier)
          Creates a new instance, i.e.
 
Method Summary
static XEventClasses deriveEventClasses(XEventClassifier classifier, XLog log)
          Creates a new set of event classes, factory method.
 boolean equals(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.
 XEventClass getByIdentity(String classIdentity)
          Returns a given event class by its identity, i.e.
 XEventClass getByIndex(int index)
          Returns a given event class by its unique index.
 Collection<XEventClass> getClasses()
          Returns the collection of event classes contained in this instance.
 XEventClassifier getClassifier()
          Returns the classifier used for determining event classes.
 XEventClass getClassOf(XEvent event)
          For any given event, returns the corresponding event class as determined by this set.
 void harmonizeIndices()
          This method harmonizeds the indices of all contained event classes.
 void register(XEvent event)
          Registers an event with this set of event classes.
 void register(XLog log)
          Registers a log with this set of event classes.
 void register(XTrace trace)
          Registers a trace with this set of event classes.
 int size()
          Returns the size of this set of event classes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classifier

protected XEventClassifier classifier
The classifier used for creating the set of event classes.


classMap

protected HashMap<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 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(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.

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(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:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object