Class XUtils


  • public final class XUtils
    extends java.lang.Object
    Commonly used methods for handling XES logs
    Author:
    F. Mannhardt
    • Field Summary

      Fields 
      Modifier and Type Field 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  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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, long timestamp)  
      static void assignTimestamp​(org.deckfour.xes.model.XEvent event, java.util.Date 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<?>>
      int
      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>
      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)
      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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INVISIBLEACTIVITY

        public static final org.deckfour.xes.classification.XEventClass INVISIBLEACTIVITY
        The invisible activity. Activity to be used for mapping silent transitions on.
      • MOVEONMODELACTIVITY

        public static final org.deckfour.xes.classification.XEventClass MOVEONMODELACTIVITY
        The move-on-model activity. Activity to be used for mapping transition on that are not covered by the log at hand. As such, they will always have to be a move-on-model.
      • STANDARDCLASSIFIER

        public static final org.deckfour.xes.classification.XEventClassifier STANDARDCLASSIFIER
    • Method Detail

      • isStandardExtensionAttribute

        public static boolean isStandardExtensionAttribute​(org.deckfour.xes.model.XAttribute attribute)
        Returns whether the attribute key matches one of the registered standard extensions of XES.
        Parameters:
        attribute -
        Returns:
        whether the attribute is one of the standard extension attributes
      • getDefaultClassifier

        public 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. If the log contains classifiers, then the first classifier is returned. Otherwise, the standard MXML classifier is constructed and returned.
        Parameters:
        log -
        Returns:
        A default classifier to use with the provided log.
      • getStandardAndLogDefinedEventClassifiers

        public 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.
        Parameters:
        log -
        Returns:
        a list of event classifiers that can be used on the log
      • getConceptName

        public static java.lang.String getConceptName​(org.deckfour.xes.model.XAttributable element)
        Returns the event name.
        Parameters:
        element -
        Returns:
        the value of the "concept:name" attribute or "null"
      • assignConceptName

        public static void assignConceptName​(org.deckfour.xes.model.XLog log,
                                             java.lang.String name)
      • assignConceptName

        public static void assignConceptName​(org.deckfour.xes.model.XEvent event,
                                             java.lang.String name)
      • assignConceptName

        public static void assignConceptName​(org.deckfour.xes.model.XTrace trace,
                                             java.lang.String name)
      • getTimestamp

        public static java.util.Date getTimestamp​(org.deckfour.xes.model.XEvent event)
        Returns the event time.
        Parameters:
        event -
        Returns:
        the value of the "time:timestamp" attribute or "null"
      • assignTimestamp

        public static void assignTimestamp​(org.deckfour.xes.model.XEvent event,
                                           java.util.Date timestamp)
      • assignTimestamp

        public static void assignTimestamp​(org.deckfour.xes.model.XEvent event,
                                           long timestamp)
      • loadLog

        public static org.deckfour.xes.model.XLog loadLog​(java.lang.String string)
                                                   throws java.io.UnsupportedEncodingException,
                                                          java.lang.Exception
        Throws:
        java.io.UnsupportedEncodingException
        java.lang.Exception
      • loadLog

        public static org.deckfour.xes.model.XLog loadLog​(java.io.File file)
                                                   throws java.io.FileNotFoundException,
                                                          java.lang.Exception
        Throws:
        java.io.FileNotFoundException
        java.lang.Exception
      • loadLog

        public static org.deckfour.xes.model.XLog loadLog​(java.io.InputStream is)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • saveLog

        public static void saveLog​(org.deckfour.xes.model.XLog log,
                                   java.io.File file)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • saveLogPlain

        public static void saveLogPlain​(org.deckfour.xes.model.XLog log,
                                        java.io.File file)
                                 throws java.io.FileNotFoundException,
                                        java.io.IOException
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • saveLogGzip

        public static void saveLogGzip​(org.deckfour.xes.model.XLog log,
                                       java.io.File file)
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • saveLogWithSerializer

        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
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • containsEventWithName

        public static boolean containsEventWithName​(java.lang.String eventName,
                                                    org.deckfour.xes.model.XTrace trace)
      • getLatestEventWithName

        public static org.deckfour.xes.model.XEvent getLatestEventWithName​(java.lang.String eventName,
                                                                           org.deckfour.xes.model.XTrace trace)
      • getAllEventNamesSorted

        public static java.util.NavigableSet<java.lang.String> getAllEventNamesSorted​(org.deckfour.xes.model.XLog log)
      • stringifyEvent

        public static java.lang.String stringifyEvent​(org.deckfour.xes.model.XEvent e,
                                                      org.deckfour.xes.classification.XEventClassifier classifier)
      • stringifyEvent

        public static java.lang.String stringifyEvent​(org.deckfour.xes.model.XEvent e)
      • stringifyTrace

        public static java.lang.String stringifyTrace​(org.deckfour.xes.model.XTrace t,
                                                      org.deckfour.xes.classification.XEventClassifier classifier)
      • stringifyTrace

        public static java.lang.String stringifyTrace​(org.deckfour.xes.model.XTrace t)
      • stringifyLog

        public static java.lang.String stringifyLog​(org.deckfour.xes.model.XLog l,
                                                    org.deckfour.xes.classification.XEventClassifier classifier)
      • stringifyLog

        public static java.lang.String stringifyLog​(org.deckfour.xes.model.XLog l)
      • stringifyAttributes

        public static java.lang.String stringifyAttributes​(org.deckfour.xes.model.XAttributeMap map)
      • cloneAttributeWithChangedKey

        public 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.
        Parameters:
        oldAttribute -
        newKey -
        Returns:
        copy of the supplied attribute
      • cloneAttributeWithChangedKeyWithFactory

        public 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.
        Parameters:
        oldAttribute -
        newKey -
        factory -
        Returns:
        copy of the supplied attribute
      • cloneLogWithoutClassifier

        public static org.deckfour.xes.model.XLog cloneLogWithoutClassifier​(org.deckfour.xes.model.XLog log)
        Creates a deep clone of the supplied event log without classifiers
        Parameters:
        log -
        Returns:
        a clone of the supplied log
      • cloneLogWithoutGlobals

        public static org.deckfour.xes.model.XLog cloneLogWithoutGlobals​(org.deckfour.xes.model.XLog log)
        Creates a deep clone of the supplied event log without globals
        Parameters:
        log -
        Returns:
        a clone of the supplied log
      • cloneLogWithoutGlobalsAndClassifiers

        public 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
        Parameters:
        log -
        Returns:
        a clone of the supplied log
      • createLogFrom

        public 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.
        Parameters:
        oldLog -
        Returns:
      • createLogFrom

        public 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.
        Parameters:
        oldLog -
        factory -
        Returns:
      • copyLogMetadata

        public 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.
        Parameters:
        oldLog -
        newLog -
      • isSameType

        public static boolean isSameType​(org.deckfour.xes.model.XAttribute obj1,
                                         org.deckfour.xes.model.XAttribute obj2)
        Checks whether both objects implement the same XAttribute interface
        Parameters:
        obj1 -
        obj2 -
        Returns:
      • getAttributeValue

        public static java.lang.Object getAttributeValue​(org.deckfour.xes.model.XAttribute attribute)
        Returns the value of the XAttribute as Object
        Parameters:
        attribute -
        Returns:
        value of the attribute
      • getAttributeClass

        public static java.lang.Class<?> getAttributeClass​(org.deckfour.xes.model.XAttribute attribute)
        Returns the Java class of the XAttribute value.
        Parameters:
        attribute -
        Returns:
        class of the attribute
      • createAttribute

        public 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.
        Parameters:
        attributeName -
        attributeValue -
        Returns:
      • createAttributeWithFactory

        public 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.
        Parameters:
        attributeName -
        attributeValue -
        factory -
        Returns:
      • createAttribute

        public 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.
        Parameters:
        attributeName -
        attributeValue -
        extension -
        Returns:
        a XAttribute with correct type
      • putAttributes

        public 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.
        Parameters:
        attributable -
        attributes -
      • putAttribute

        public static void putAttribute​(org.deckfour.xes.model.XAttributable attributable,
                                        org.deckfour.xes.model.XAttribute attribute)
        Adds a single XAttribute to the supplied XAttributable.
        Parameters:
        attributable -
        attribute -
      • renameLogWithProMLabel

        public 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
        Parameters:
        context -
        log -
        Returns:
        the old name
      • createEventClasses

        public 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. Uses the XEvent cached in the XLogInfo if available and in case the trace are, in fact, a XLog.
        Parameters:
        classifier -
        traces -
        Returns:
      • getEventAttributeKeys

        public static java.util.Set<java.lang.String> getEventAttributeKeys​(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
      • getEventAttributeTypes

        public static java.util.Map<java.lang.String,​java.lang.Class<?>> getEventAttributeTypes​(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
      • getTraceAttributeKeys

        public static java.util.Set<java.lang.String> getTraceAttributeKeys​(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
      • getTraceAttributeTypes

        public static java.util.Map<java.lang.String,​java.lang.Class<?>> getTraceAttributeTypes​(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces)
      • getVariantsByClassifier

        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)
        Groups traces in a ListMultimap by their event classification. A ListMultimap instead of an SetMultimap is returned as the input traces are not required to be a Set.
        Parameters:
        traces -
        classifier -
        Returns:
      • countVariantsByClassifier

        public static int countVariantsByClassifier​(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
                                                    org.deckfour.xes.classification.XEventClassifier classifier)
      • getVariantsByClassifier

        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)
        Groups traces in a ListMultimap by their event classification. A ListMultimap instead of an SetMultimap is returned as the input traces are not required to be a Set.
        Parameters:
        traces -
        eventClasses -
        Returns:
      • countVariantsByClassifier

        public static int countVariantsByClassifier​(java.lang.Iterable<org.deckfour.xes.model.XTrace> traces,
                                                    org.deckfour.xes.classification.XEventClasses eventClasses)
      • getVariants

        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)
        Groups traces in a ListMultimap by a generic Function. A ListMultimap instead of an SetMultimap is returned as the input traces are not required to be a Set.
        Parameters:
        traces -
        variantFunction -
        Returns:
      • countVariants

        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)