Class LogUtils


  • public class LogUtils
    extends java.lang.Object
    Utilities that can be used over logs
    • Constructor Summary

      Constructors 
      Constructor Description
      LogUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Collection<java.lang.String> getActivitiesFromLog​(org.deckfour.xes.model.XLog log)  
      static java.util.Collection<java.lang.String> getEventAttributesKeys​(org.deckfour.xes.model.XLog log)  
      static java.util.Map<java.lang.String,​java.lang.Integer> getEventCountPerActivity​(org.deckfour.xes.model.XLog log)
      Calculates how many events the event log contains for each activity.
      static java.lang.String getEventLogName​(org.deckfour.xes.model.XLog eventLog)
      Extract the event log name given the event log.
      static java.util.Set<org.apache.commons.math3.util.Pair<java.lang.String,​java.lang.String>> getFollowRelations​(org.deckfour.xes.model.XLog log, int followRelationsDistanceLimit)
      Given the log take all pairs of events (their names in particular) that occur together in some specified distance limit.
      static org.deckfour.xes.model.XLog readLogFromFile​(java.io.File file)
      Reads the event log that is written in the file
      static org.deckfour.xes.model.XLog readLogFromFile​(java.io.InputStream is)
      Reads an event log from an input stream
      static org.deckfour.xes.model.XLog readLogFromFile​(java.lang.String filePath)
      Reads the event log that is written in the file with the given file path
      • Methods inherited from class java.lang.Object

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

      • LogUtils

        public LogUtils()
    • Method Detail

      • readLogFromFile

        public static org.deckfour.xes.model.XLog readLogFromFile​(java.lang.String filePath)
                                                           throws java.lang.Exception
        Reads the event log that is written in the file with the given file path
        Parameters:
        filePath - : the file path of the file that contains the event log
        Returns:
        object of type XLog that contains the event log from the file
        Throws:
        java.lang.Exception
      • getActivitiesFromLog

        public static java.util.Collection<java.lang.String> getActivitiesFromLog​(org.deckfour.xes.model.XLog log)
      • getEventAttributesKeys

        public static java.util.Collection<java.lang.String> getEventAttributesKeys​(org.deckfour.xes.model.XLog log)
      • readLogFromFile

        public static org.deckfour.xes.model.XLog readLogFromFile​(java.io.File file)
                                                           throws java.lang.Exception
        Reads the event log that is written in the file
        Parameters:
        file - : the file that contains the event log
        Returns:
        object of type XLog that contains the event log from the file
        Throws:
        java.lang.Exception
      • readLogFromFile

        public static org.deckfour.xes.model.XLog readLogFromFile​(java.io.InputStream is)
                                                           throws java.lang.Exception
        Reads an event log from an input stream
        Parameters:
        is - : the input stream containing the event log
        Returns:
        object of type XLog that contains the event log from the input stream
        Throws:
        java.lang.Exception
      • getFollowRelations

        public static java.util.Set<org.apache.commons.math3.util.Pair<java.lang.String,​java.lang.String>> getFollowRelations​(org.deckfour.xes.model.XLog log,
                                                                                                                                    int followRelationsDistanceLimit)
        Given the log take all pairs of events (their names in particular) that occur together in some specified distance limit.
        Parameters:
        log - : the log from which we want to get all follow relations given some distance limit
        followRelationsDistanceLimit - : the distance limit in which the follow relation can happen
        Returns:
        set of pairs, where each pair is consisted of the events that are in a follow relation
      • getEventLogName

        public static java.lang.String getEventLogName​(org.deckfour.xes.model.XLog eventLog)
        Extract the event log name given the event log.
        Parameters:
        eventLog - : the event log object
        Returns:
        the name
      • getEventCountPerActivity

        public static java.util.Map<java.lang.String,​java.lang.Integer> getEventCountPerActivity​(org.deckfour.xes.model.XLog log)
        Calculates how many events the event log contains for each activity.
        Parameters:
        log - the event log object
        Returns:
        the map of event counts per activity