org.deckfour.xes.classification
Class XEventAttributeClassifier

java.lang.Object
  extended by org.deckfour.xes.classification.XEventAttributeClassifier
All Implemented Interfaces:
Comparable<XEventAttributeClassifier>, XEventClassifier
Direct Known Subclasses:
XEventAndClassifier, XEventLifeTransClassifier, XEventNameClassifier, XEventResourceClassifier

public class XEventAttributeClassifier
extends Object
implements XEventClassifier, Comparable<XEventAttributeClassifier>

Event classifier which considers two events as equal, if, for a set of given (configurable) attributes, they have the same values.

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

Field Summary
protected  String[] keys
          Keys of the attributes used for event comparison.
protected  String name
          Name of the classifier
 
Constructor Summary
XEventAttributeClassifier(String name, String... keys)
          Creates a new instance, configured by the given attribute.
 
Method Summary
 int compareTo(XEventAttributeClassifier o)
           
 boolean equals(Object o)
           
 String getClassIdentity(XEvent event)
          Retrieves the unique class identity string of a given event.
 String[] getDefiningAttributeKeys()
          Retrieves the set of attribute keys which are used in this event classifier (May be used for the construction of events that are not part of an existing event class).
 String name()
          Returns the name of this comparator
 boolean sameEventClass(XEvent eventA, XEvent eventB)
          Checks whether two event instances correspond to the same event class, i.e.
 void setName(String name)
          Assigns a custom name to this classifier
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

keys

protected String[] keys
Keys of the attributes used for event comparison.


name

protected String name
Name of the classifier

Constructor Detail

XEventAttributeClassifier

public XEventAttributeClassifier(String name,
                                 String... keys)
Creates a new instance, configured by the given attribute.

Parameters:
name - Name of the classifier.
attribute - Attribute to be used for event classification.
Method Detail

getClassIdentity

public String getClassIdentity(XEvent event)
Description copied from interface: XEventClassifier
Retrieves the unique class identity string of a given event.

Specified by:
getClassIdentity in interface XEventClassifier

setName

public void setName(String name)
Assigns a custom name to this classifier

Specified by:
setName in interface XEventClassifier
Parameters:
name - Name to be assigned to this classifier.

name

public String name()
Description copied from interface: XEventClassifier
Returns the name of this comparator

Specified by:
name in interface XEventClassifier

sameEventClass

public boolean sameEventClass(XEvent eventA,
                              XEvent eventB)
Description copied from interface: XEventClassifier
Checks whether two event instances correspond to the same event class, i.e. are equal in that sense.

Specified by:
sameEventClass in interface XEventClassifier

toString

public String toString()
Overrides:
toString in class Object

getDefiningAttributeKeys

public String[] getDefiningAttributeKeys()
Description copied from interface: XEventClassifier
Retrieves the set of attribute keys which are used in this event classifier (May be used for the construction of events that are not part of an existing event class).

Specified by:
getDefiningAttributeKeys in interface XEventClassifier
Returns:
A set of attribute keys, which are used for defining this classifier.

compareTo

public int compareTo(XEventAttributeClassifier o)
Specified by:
compareTo in interface Comparable<XEventAttributeClassifier>

equals

public boolean equals(Object o)
Overrides:
equals in class Object