本文整理匯總了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;
}