public final class XUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.deckfour.xes.classification.XEventClass |
INVISIBLEACTIVITY
The invisible activity.
|
static org.deckfour.xes.classification.XEventClass |
MOVEONMODELACTIVITY
The move-on-model activity.
|
static org.deckfour.xes.classification.XEventClassifier |
STANDARDCLASSIFIER |
Modifier and Type | Method and Description |
---|---|
static void |
assignConceptName(org.deckfour.xes.model.XEvent event,
java.lang.String name) |
static void |
assignConceptName(org.deckfour.xes.model.XLog log,
java.lang.String name) |
static void |
assignConceptName(org.deckfour.xes.model.XTrace trace,
java.lang.String name) |
static void |
assignTimestamp(org.deckfour.xes.model.XEvent event,
java.util.Date timestamp) |
static void |
assignTimestamp(org.deckfour.xes.model.XEvent event,
long timestamp) |
static org.deckfour.xes.model.XAttribute |
cloneAttributeWithChangedKey(org.deckfour.xes.model.XAttribute oldAttribute,
java.lang.String newKey)
Creates a deep clone of the
XAttribute with the same value, but a
changed key. |
static org.deckfour.xes.model.XAttribute |
cloneAttributeWithChangedKeyWithFactory(org.deckfour.xes.model.XAttribute oldAttribute,
java.lang.String newKey,
org.deckfour.xes.factory.XFactory factory)
Creates a deep clone of the
XAttribute with the same value, but a
changed key. |
static org.deckfour.xes.model.XLog |
cloneLogWithoutClassifier(org.deckfour.xes.model.XLog log)
Creates a deep clone of the supplied event log without classifiers
|
static org.deckfour.xes.model.XLog |
cloneLogWithoutGlobals(org.deckfour.xes.model.XLog log)
Creates a deep clone of the supplied event log without globals
|
static org.deckfour.xes.model.XLog |
cloneLogWithoutGlobalsAndClassifiers(org.deckfour.xes.model.XLog log)
Creates a deep clone of the supplied event log without globals and
without classifiers
|
static boolean |
containsEventWithName(java.lang.String eventName,
org.deckfour.xes.model.XTrace trace) |
static void |
copyLogMetadata(org.deckfour.xes.model.XLog oldLog,
org.deckfour.xes.model.XLog newLog)
Copies the meta data (classifiers, globals, extension) from the oldLog to
the newLog.
|
static <T extends TraceVariant<?>> |
countVariants(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
com.google.common.base.Function<org.deckfour.xes.model.XTrace,T> variantFunction) |
static int |
countVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
org.deckfour.xes.classification.XEventClasses eventClasses) |
static int |
countVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
org.deckfour.xes.classification.XEventClassifier classifier) |
static org.deckfour.xes.model.XAttribute |
createAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
Creates an appropriate
XAttribute , decided on the type of the
parameter atttributeValue. |
static org.deckfour.xes.model.XAttribute |
createAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
org.deckfour.xes.extension.XExtension extension)
Creates an appropriate
XAttribute , deciding by the type of the
parameter atttributeValue. |
static org.deckfour.xes.model.XAttribute |
createAttributeWithFactory(java.lang.String attributeName,
java.lang.Object attributeValue,
org.deckfour.xes.factory.XFactory factory)
Creates an appropriate
XAttribute , decided on the type of the
parameter atttributeValue. |
static org.deckfour.xes.classification.XEventClasses |
createEventClasses(org.deckfour.xes.classification.XEventClassifier classifier,
java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
Obtain the event classes from the supplied collection of traces using the
specified classifier.
|
static org.deckfour.xes.model.XLog |
createLogFrom(org.deckfour.xes.model.XLog oldLog)
Creates a new log with attributes and meta data (classifiers, globals,
extension) from the oldLog.
|
static org.deckfour.xes.model.XLog |
createLogFrom(org.deckfour.xes.model.XLog oldLog,
org.deckfour.xes.factory.XFactory factory)
Creates a new log with attributes and meta data (classifiers, globals,
extension) from the oldLog.
|
static java.util.NavigableSet<java.lang.String> |
getAllEventNamesSorted(org.deckfour.xes.model.XLog log) |
static java.lang.Class<?> |
getAttributeClass(org.deckfour.xes.model.XAttribute attribute)
Returns the Java class of the
XAttribute value. |
static java.lang.Object |
getAttributeValue(org.deckfour.xes.model.XAttribute attribute)
Returns the value of the
XAttribute as Object |
static java.lang.String |
getConceptName(org.deckfour.xes.model.XAttributable element)
Returns the event name.
|
static org.deckfour.xes.classification.XEventClassifier |
getDefaultClassifier(org.deckfour.xes.model.XLog log)
Added by Eric Verbeek
Returns a default classifier to use with an event log.
|
static java.util.Set<java.lang.String> |
getEventAttributeKeys(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces) |
static java.util.Map<java.lang.String,java.lang.Class<?>> |
getEventAttributeTypes(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces) |
static org.deckfour.xes.model.XEvent |
getLatestEventWithName(java.lang.String eventName,
org.deckfour.xes.model.XTrace trace) |
static java.util.List<org.deckfour.xes.classification.XEventClassifier> |
getStandardAndLogDefinedEventClassifiers(org.deckfour.xes.model.XLog log)
Returns both the event classifiers defined by the XLog, as well as the
three standard classifiers
XLogInfoImpl.NAME_CLASSIFIER ,
XLogInfoImpl.RESOURCE_CLASSIFIER and
XLogInfoImpl.STANDARD_CLASSIFIER . |
static java.util.Date |
getTimestamp(org.deckfour.xes.model.XEvent event)
Returns the event time.
|
static java.util.Set<java.lang.String> |
getTraceAttributeKeys(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces) |
static java.util.Map<java.lang.String,java.lang.Class<?>> |
getTraceAttributeTypes(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces) |
static <T extends TraceVariant<E>,E> |
getVariants(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
com.google.common.base.Function<org.deckfour.xes.model.XTrace,T> variantFunction)
Groups traces in a
ListMultimap by a generic Function . |
static com.google.common.collect.ImmutableListMultimap<TraceVariantByClassifier,org.deckfour.xes.model.XTrace> |
getVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
org.deckfour.xes.classification.XEventClasses eventClasses)
Groups traces in a
ListMultimap by their event classification. |
static com.google.common.collect.ImmutableListMultimap<TraceVariantByClassifier,org.deckfour.xes.model.XTrace> |
getVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
org.deckfour.xes.classification.XEventClassifier classifier)
Groups traces in a
ListMultimap by their event classification. |
static boolean |
isSameType(org.deckfour.xes.model.XAttribute obj1,
org.deckfour.xes.model.XAttribute obj2)
Checks whether both objects implement the same XAttribute interface
|
static boolean |
isStandardExtensionAttribute(org.deckfour.xes.model.XAttribute attribute)
Returns whether the attribute key matches one of the registered standard
extensions of XES.
|
static org.deckfour.xes.model.XLog |
loadLog(java.io.File file) |
static org.deckfour.xes.model.XLog |
loadLog(java.io.InputStream is) |
static org.deckfour.xes.model.XLog |
loadLog(java.lang.String string) |
static void |
putAttribute(org.deckfour.xes.model.XAttributable attributable,
org.deckfour.xes.model.XAttribute attribute)
Adds a single
XAttribute to the supplied XAttributable . |
static void |
putAttributes(org.deckfour.xes.model.XAttributable attributable,
java.lang.Iterable<org.deckfour.xes.model.XAttribute> attributes)
Adds multiple
XAttribute to the supplied XAttributable . |
static java.lang.String |
renameLogWithProMLabel(org.processmining.framework.plugin.PluginContext context,
org.deckfour.xes.model.XLog log)
Rename the XLog with the label for the ProM provided object
|
static void |
saveLog(org.deckfour.xes.model.XLog log,
java.io.File file) |
static void |
saveLogGzip(org.deckfour.xes.model.XLog log,
java.io.File file) |
static void |
saveLogPlain(org.deckfour.xes.model.XLog log,
java.io.File file) |
static void |
saveLogWithSerializer(org.deckfour.xes.model.XLog log,
java.io.File file,
org.deckfour.xes.out.XSerializer logSerializer) |
static java.lang.String |
stringifyAttributes(org.deckfour.xes.model.XAttributeMap map) |
static java.lang.String |
stringifyEvent(org.deckfour.xes.model.XEvent e) |
static java.lang.String |
stringifyEvent(org.deckfour.xes.model.XEvent e,
org.deckfour.xes.classification.XEventClassifier classifier) |
static java.lang.String |
stringifyLog(org.deckfour.xes.model.XLog l) |
static java.lang.String |
stringifyLog(org.deckfour.xes.model.XLog l,
org.deckfour.xes.classification.XEventClassifier classifier) |
static java.lang.String |
stringifyTrace(org.deckfour.xes.model.XTrace t) |
static java.lang.String |
stringifyTrace(org.deckfour.xes.model.XTrace t,
org.deckfour.xes.classification.XEventClassifier classifier) |
public static final org.deckfour.xes.classification.XEventClass INVISIBLEACTIVITY
public static final org.deckfour.xes.classification.XEventClass MOVEONMODELACTIVITY
public static final org.deckfour.xes.classification.XEventClassifier STANDARDCLASSIFIER
public static boolean isStandardExtensionAttribute(org.deckfour.xes.model.XAttribute attribute)
attribute
- public static org.deckfour.xes.classification.XEventClassifier getDefaultClassifier(org.deckfour.xes.model.XLog log)
log
- public static java.util.List<org.deckfour.xes.classification.XEventClassifier> getStandardAndLogDefinedEventClassifiers(org.deckfour.xes.model.XLog log)
XLogInfoImpl.NAME_CLASSIFIER
,
XLogInfoImpl.RESOURCE_CLASSIFIER
and
XLogInfoImpl.STANDARD_CLASSIFIER
.log
- public static java.lang.String getConceptName(org.deckfour.xes.model.XAttributable element)
element
- public static void assignConceptName(org.deckfour.xes.model.XLog log, java.lang.String name)
public static void assignConceptName(org.deckfour.xes.model.XEvent event, java.lang.String name)
public static void assignConceptName(org.deckfour.xes.model.XTrace trace, java.lang.String name)
public static java.util.Date getTimestamp(org.deckfour.xes.model.XEvent event)
event
- public static void assignTimestamp(org.deckfour.xes.model.XEvent event, java.util.Date timestamp)
public static void assignTimestamp(org.deckfour.xes.model.XEvent event, long timestamp)
public static org.deckfour.xes.model.XLog loadLog(java.lang.String string) throws java.io.UnsupportedEncodingException, java.lang.Exception
java.io.UnsupportedEncodingException
java.lang.Exception
public static org.deckfour.xes.model.XLog loadLog(java.io.File file) throws java.io.FileNotFoundException, java.lang.Exception
java.io.FileNotFoundException
java.lang.Exception
public static org.deckfour.xes.model.XLog loadLog(java.io.InputStream is) throws java.lang.Exception
java.lang.Exception
public static void saveLog(org.deckfour.xes.model.XLog log, java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static void saveLogPlain(org.deckfour.xes.model.XLog log, java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static void saveLogGzip(org.deckfour.xes.model.XLog log, java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static void saveLogWithSerializer(org.deckfour.xes.model.XLog log, java.io.File file, org.deckfour.xes.out.XSerializer logSerializer) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static boolean containsEventWithName(java.lang.String eventName, org.deckfour.xes.model.XTrace trace)
public static org.deckfour.xes.model.XEvent getLatestEventWithName(java.lang.String eventName, org.deckfour.xes.model.XTrace trace)
public static java.util.NavigableSet<java.lang.String> getAllEventNamesSorted(org.deckfour.xes.model.XLog log)
public static java.lang.String stringifyEvent(org.deckfour.xes.model.XEvent e, org.deckfour.xes.classification.XEventClassifier classifier)
public static java.lang.String stringifyEvent(org.deckfour.xes.model.XEvent e)
public static java.lang.String stringifyTrace(org.deckfour.xes.model.XTrace t, org.deckfour.xes.classification.XEventClassifier classifier)
public static java.lang.String stringifyTrace(org.deckfour.xes.model.XTrace t)
public static java.lang.String stringifyLog(org.deckfour.xes.model.XLog l, org.deckfour.xes.classification.XEventClassifier classifier)
public static java.lang.String stringifyLog(org.deckfour.xes.model.XLog l)
public static java.lang.String stringifyAttributes(org.deckfour.xes.model.XAttributeMap map)
public static org.deckfour.xes.model.XAttribute cloneAttributeWithChangedKey(org.deckfour.xes.model.XAttribute oldAttribute, java.lang.String newKey)
XAttribute
with the same value, but a
changed key.oldAttribute
- newKey
- public static org.deckfour.xes.model.XAttribute cloneAttributeWithChangedKeyWithFactory(org.deckfour.xes.model.XAttribute oldAttribute, java.lang.String newKey, org.deckfour.xes.factory.XFactory factory)
XAttribute
with the same value, but a
changed key.oldAttribute
- newKey
- factory
- public static org.deckfour.xes.model.XLog cloneLogWithoutClassifier(org.deckfour.xes.model.XLog log)
log
- public static org.deckfour.xes.model.XLog cloneLogWithoutGlobals(org.deckfour.xes.model.XLog log)
log
- public static org.deckfour.xes.model.XLog cloneLogWithoutGlobalsAndClassifiers(org.deckfour.xes.model.XLog log)
log
- public static org.deckfour.xes.model.XLog createLogFrom(org.deckfour.xes.model.XLog oldLog)
oldLog
- public static org.deckfour.xes.model.XLog createLogFrom(org.deckfour.xes.model.XLog oldLog, org.deckfour.xes.factory.XFactory factory)
oldLog
- factory
- public static void copyLogMetadata(org.deckfour.xes.model.XLog oldLog, org.deckfour.xes.model.XLog newLog)
oldLog
- newLog
- public static boolean isSameType(org.deckfour.xes.model.XAttribute obj1, org.deckfour.xes.model.XAttribute obj2)
obj1
- obj2
- public static java.lang.Object getAttributeValue(org.deckfour.xes.model.XAttribute attribute)
XAttribute
as Object
attribute
- public static java.lang.Class<?> getAttributeClass(org.deckfour.xes.model.XAttribute attribute)
XAttribute
value.attribute
- public static org.deckfour.xes.model.XAttribute createAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
XAttribute
, decided on the type of the
parameter atttributeValue.attributeName
- attributeValue
- public static org.deckfour.xes.model.XAttribute createAttributeWithFactory(java.lang.String attributeName, java.lang.Object attributeValue, org.deckfour.xes.factory.XFactory factory)
XAttribute
, decided on the type of the
parameter atttributeValue.attributeName
- attributeValue
- factory
- public static org.deckfour.xes.model.XAttribute createAttribute(java.lang.String attributeName, java.lang.Object attributeValue, org.deckfour.xes.extension.XExtension extension)
XAttribute
, deciding by the type of the
parameter atttributeValue.attributeName
- attributeValue
- extension
- XAttribute
with correct typepublic static void putAttributes(org.deckfour.xes.model.XAttributable attributable, java.lang.Iterable<org.deckfour.xes.model.XAttribute> attributes)
XAttribute
to the supplied XAttributable
.attributable
- attributes
- public static void putAttribute(org.deckfour.xes.model.XAttributable attributable, org.deckfour.xes.model.XAttribute attribute)
XAttribute
to the supplied XAttributable
.attributable
- attribute
- public static java.lang.String renameLogWithProMLabel(org.processmining.framework.plugin.PluginContext context, org.deckfour.xes.model.XLog log)
context
- log
- public static org.deckfour.xes.classification.XEventClasses createEventClasses(org.deckfour.xes.classification.XEventClassifier classifier, java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
XEvent
cached in the
XLogInfo
if available and in case the trace are, in fact, a
XLog
.classifier
- traces
- public static java.util.Set<java.lang.String> getEventAttributeKeys(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
public static java.util.Map<java.lang.String,java.lang.Class<?>> getEventAttributeTypes(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
public static java.util.Set<java.lang.String> getTraceAttributeKeys(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
public static java.util.Map<java.lang.String,java.lang.Class<?>> getTraceAttributeTypes(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
public static com.google.common.collect.ImmutableListMultimap<TraceVariantByClassifier,org.deckfour.xes.model.XTrace> getVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces, org.deckfour.xes.classification.XEventClassifier classifier)
ListMultimap
by their event classification. A
ListMultimap
instead of an SetMultimap
is returned as the
input traces are not required to be a Set
.traces
- classifier
- public static int countVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces, org.deckfour.xes.classification.XEventClassifier classifier)
public static com.google.common.collect.ImmutableListMultimap<TraceVariantByClassifier,org.deckfour.xes.model.XTrace> getVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces, org.deckfour.xes.classification.XEventClasses eventClasses)
ListMultimap
by their event classification. A
ListMultimap
instead of an SetMultimap
is returned as the
input traces are not required to be a Set
.traces
- eventClasses
- public static int countVariantsByClassifier(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces, org.deckfour.xes.classification.XEventClasses eventClasses)
public static <T extends TraceVariant<E>,E> com.google.common.collect.ImmutableListMultimap<T,org.deckfour.xes.model.XTrace> getVariants(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces, com.google.common.base.Function<org.deckfour.xes.model.XTrace,T> variantFunction)
ListMultimap
by a generic Function
. A
ListMultimap
instead of an SetMultimap
is returned as the
input traces are not required to be a Set
.traces
- variantFunction
- public static <T extends TraceVariant<?>> int countVariants(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces, com.google.common.base.Function<org.deckfour.xes.model.XTrace,T> variantFunction)