本文整理汇总了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;
}
示例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;
}