當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。