当前位置: 首页>>代码示例>>Java>>正文


Java LogTrace.reduceToActivities方法代码示例

本文整理汇总了Java中de.uni.freiburg.iig.telematik.sewol.log.LogTrace.reduceToActivities方法的典型用法代码示例。如果您正苦于以下问题:Java LogTrace.reduceToActivities方法的具体用法?Java LogTrace.reduceToActivities怎么用?Java LogTrace.reduceToActivities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.uni.freiburg.iig.telematik.sewol.log.LogTrace的用法示例。


在下文中一共展示了LogTrace.reduceToActivities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parse

import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入方法依赖的package包/类
@Override
        public List<List<LogTrace<LogEntry>>> parse(InputStream inputStream, ParsingMode parsingMode) throws ParameterException, ParserException {
                try {
                        inputStream.available();
                } catch (IOException e) {
                        throw new ParameterException("Unable to read input file: " + e.getMessage());
                }

                parsedLogFiles = new ArrayList<>();

                List<LogTrace<LogEntry>> traceList = new ArrayList<>();
//		Set<LogTrace<LogEntry>> traceSet = new HashSet<LogTrace<LogEntry>>();
                parsedLogFiles.add(traceList);

                InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
                BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
                String nextLine = null;
                int traceCount = 0;

                Set<List<String>> activitySequences = new HashSet<>();
                try {
                        while ((nextLine = bufferedReader.readLine()) != null) {
                                LogTrace<LogEntry> newTrace = new LogTrace<>(++traceCount);
                                StringTokenizer tokenizer = new StringTokenizer(nextLine);
                                while (tokenizer.hasMoreTokens()) {
                                        String nextToken = tokenizer.nextToken();
                                        if (nextToken != null && !nextToken.isEmpty()) {
                                                newTrace.addEntry(new LogEntry(nextToken));
                                        }
                                }
                                switch (parsingMode) {
                                        case COMPLETE:
                                                traceList.add(newTrace);
                                                break;
                                        case DISTINCT_ACTIVITY_SEQUENCES:
//			case DISTINCT_TRACES:
                                                if (activitySequences.add(newTrace.getActivities())) {
                                                        newTrace.reduceToActivities();
                                                        traceList.add(newTrace);
                                                }
                                                break;
                                }
                        }
                } catch (IOException ex) {
                        throw new ParserException(ex);
                }
                summaries.add(new LogSummary<>(traceList));
                return parsedLogFiles;
        }
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:50,代码来源:PetrifyParser.java

示例2: parse

import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入方法依赖的package包/类
@Override
        public List<List<LogTrace<LogEntry>>> parse(InputStream inputStream, ParsingMode parsingMode) throws ParameterException, ParserException {
                try {
                        inputStream.available();
                } catch (IOException e) {
                        throw new ParameterException("Unable to read input file: " + e.getMessage());
                }

                parsedLogFiles = new ArrayList<>();
                List<LogTrace<LogEntry>> traceList = new ArrayList<>();
                parsedLogFiles.add(traceList);

                InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
                BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
                String nextLine = null;
                int traceCount = 0;

                Set<List<String>> activitySequences = new HashSet<>();
                try {
                        while ((nextLine = bufferedReader.readLine()) != null) {
                                LogTrace<LogEntry> newTrace = new LogTrace<>(++traceCount);
                                for (String nextToken : nextLine.split(delimiter)) {
                                        if (nextToken != null && !nextToken.isEmpty()) {
                                                newTrace.addEntry(new LogEntry(nextToken));
                                        }
                                }
                                switch (parsingMode) {
                                        case COMPLETE:
                                                traceList.add(newTrace);
                                                break;
//			case DISTINCT_TRACES:
                                        case DISTINCT_ACTIVITY_SEQUENCES:
                                                if (activitySequences.add(newTrace.getActivities())) {
                                                        newTrace.reduceToActivities();
                                                        traceList.add(newTrace);
                                                }
                                                break;
                                }
                        }
                } catch (IOException ex) {
                        throw new ParserException(ex);
                }

                summaries.add(new LogSummary<>(traceList));
                return parsedLogFiles;
        }
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:47,代码来源:PlainParser.java


注:本文中的de.uni.freiburg.iig.telematik.sewol.log.LogTrace.reduceToActivities方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。