本文整理汇总了Java中de.uni.freiburg.iig.telematik.sewol.log.LogTrace类的典型用法代码示例。如果您正苦于以下问题:Java LogTrace类的具体用法?Java LogTrace怎么用?Java LogTrace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LogTrace类属于de.uni.freiburg.iig.telematik.sewol.log包,在下文中一共展示了LogTrace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ReplayResult
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
public ReplayResult(Collection<LogTrace<E>> fittingTraces,
Collection<LogTrace<E>> nonFittingTraces,
Collection<List<String>> fittingSequences,
Collection<List<String>> nonFittingSequences) {
Validate.notNull(fittingTraces);
Validate.notNull(nonFittingTraces);
Validate.notNull(fittingSequences);
Validate.notNull(nonFittingSequences);
this.numTraces = fittingTraces.size() + nonFittingTraces.size();
this.numSequences = fittingSequences.size() + nonFittingSequences.size();
this.fittingTraces = fittingTraces;
this.nonFittingTraces = nonFittingTraces;
this.fittingSequences = fittingSequences;
this.nonFittingSequences = nonFittingSequences;
portionFitting = (fittingTraces.size() + 0.0) / getCount();
portionNonFitting = (nonFittingTraces.size() + 0.0) / getCount();
}
示例2: parse
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
/**
* Parses the specified log file and returns a collection of processes.
*
* @param inputStream {@link InputStream} to parse
* @param parsingMode
* @return Collection of processes, which consist of a collection of
* instances, which again consist of a collection of {@link LogTrace}
* objects.
* @throws ParameterException Gets thrown if there's a discrepancy in
* how the file should be interpreted.
* @throws ParserException Gets thrown if the given file can't be read,
* is a directory, or doesn't exist.
*/
@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());
}
try {
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
MXMLSAXHandler handler = new MXMLSAXHandler();
parser.parse(inputStream, handler);
summaries.addAll(handler.summaries);
parsedLogFiles = handler.logs;
return parsedLogFiles;
} catch (ParserConfigurationException | SAXException | IOException ex) {
throw new ParserException(ex);
}
}
示例3: getLogEntries
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
public List<List<LogTrace<LogEntry>>> getLogEntries() {
List<List<LogTrace<LogEntry>>> parsedLogFiles = new ArrayList<>();
List<LogTrace<LogEntry>> traceList = new ArrayList<>();
parsedLogFiles.add(traceList);
int i = 0;
for (Entry<String, ISciffLogTrace> entry : traces.entrySet()) {
LogTrace<LogEntry> logTrace = new LogTrace<>(i);
i++;
for (int j = 0; j < entry.getValue().size(); j++) {
String name;
try {
ISciffLogEntry iSciffLogEntry=entry.getValue().get(j);
name = entry.getValue().get(j).getElement();
LogEntry logEntry = new LogEntry(name);
addAttributes(logEntry, entry.getValue().get(j));
//logEntry.addTime(iSciffLogEntry.getTimestamp().getTime());
logEntry.setTimestamp(iSciffLogEntry.getTimestamp());
logEntry.setOriginator(iSciffLogEntry.getOriginator());
logTrace.addEntry(logEntry);
} catch (IndexOutOfBoundsException | IOException | LockingException e) {
//continue
}
}
traceList.add(logTrace);
}
return parsedLogFiles;
}
示例4: setLogTraces
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
public void setLogTraces(Collection<LogTrace<E>> logTraces){
Validate.notNull(logTraces);
if(logTraces instanceof List){
this.logTraces = (List<LogTrace<E>>) logTraces;
} else {
this.logTraces = new ArrayList<LogTrace<E>>(logTraces);
}
activitySequences = LogTraceUtils.createStringRepresentation(this.logTraces, true);
}
示例5: parse
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public List<List<LogTrace<LogEntry>>> parse(File file, ParsingMode parsingMode) throws IOException, ParserException, ParameterException {
Validate.noDirectory(file);
if (!file.canRead()) {
throw new ParameterException("Unable to read input file!");
}
try {
InputStream is = new FileInputStream(file);
return parse(is, parsingMode);
} catch (FileNotFoundException | ParameterException | ParserException e) {
throw new ParserException("Exception while parsing: " + e.getMessage());
}
}
示例6: getParsedLog
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public List<LogTrace<LogEntry>> getParsedLog(int index) throws ParameterException {
if (!parsed()) {
throw new ParameterException("Log not parsed yet!");
}
Validate.notNegative(index);
if (index > parsedLogFiles() - 1) {
throw new ParameterException(ErrorCode.RANGEVIOLATION, "No log for index " + index);
}
return parsedLogFiles.get(index);
}
示例7: parse
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
public static List<List<LogTrace<LogEntry>>> parse(File file, ParsingMode parsingMode) throws IOException, ParserException {
validateFile(file);
LogParsingFormat format = guessFormat(file);
if (format == null) {
throw new ParserException(ErrorCode.UNKNOWN_FILE_EXTENSION);
}
LogParserInterface parser = getParser(file, format);
return parser.parse(file, parsingMode);
}
示例8: startElement
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
switch (qName) {
case MXMLLogFormat.ELEMENT_LOG:
currentLog = new ArrayList<>();
currentSummary = new LogSummary<>();
break;
case MXMLLogFormat.ELEMENT_TRACE:
if (attributes.getIndex(MXMLLogFormat.ATTRIBUTE_ID) >= 0) {
String idString = attributes.getValue(attributes.getIndex(MXMLLogFormat.ATTRIBUTE_ID));
currentTrace = new LogTrace<>(idStrToInt(idString));
} else {
currentTrace = new LogTrace<>();
}
break;
case MXMLLogFormat.ELEMENT_ENTRY:
currentEntry = new LogEntry();
break;
case MXMLLogFormat.ELEMENT_ACTIVITY:
case MXMLLogFormat.ELEMENT_TYPE:
case MXMLLogFormat.ELEMENT_TIME:
case MXMLLogFormat.ELEMENT_ORIGINATOR:
lastCharacters.setLength(0);
recordCharacters = true;
break;
case MXMLLogFormat.ELEMENT_ATTRIBUTE:
if (currentEntry != null) {
lastCharacters.setLength(0);
recordCharacters = true;
if (attributes.getIndex(MXMLLogFormat.ATTRIBUTE_NAME) >= 0) {
String nameString = attributes.getValue(attributes.getIndex(MXMLLogFormat.ATTRIBUTE_NAME)).intern();
currentAttribute = new DataAttribute(nameString);
}
}
break;
}
}
示例9: writeTrace
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
/**
* This method is only allowed in the trace perspective.
* @param <E>
* @param logTrace The log trace to write.
* @throws PerspectiveException
* @throws IOException
*/
public <E extends LogEntry> void writeTrace(LogTrace<E> logTrace) throws PerspectiveException, IOException{
if(logPerspective == LogPerspective.ACTIVITY_PERSPECTIVE)
throw new PerspectiveException(PerspectiveError.WRITE_TRACE_IN_ACTIVITY_PERSPECTIVE);
prepare();
if(!headerWritten){
write(logFormat.getFileHeader());
headerWritten = true;
}
output.write(logFormat.getTraceAsString(logTrace));
}
示例10: accept
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public boolean accept(LogTrace<E> trace) {
for (E entry : trace.getEntries()) {
if (startDate != null && entry.getTimestamp().before(startDate)) {
return isInverted() ^ false;
}
if (endDate != null && entry.getTimestamp().after(endDate)) {
return isInverted() ^ false;
}
}
return isInverted() ^ true;
}
示例11: accept
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public boolean accept(LogTrace<E> trace) {
for (E entry : trace.getEntries()) {
switch (parameter) {
case ACTIVITY:
if (entry.getActivity() == null) {
return isInverted() ^ (value == null);
} else if (entry.getActivity().equals(value)) {
return isInverted() ^ true;
}
break;
case SUBJECT:
if (entry.getOriginator() == null) {
return isInverted() ^ (value == null);
} else if (entry.getOriginator().equals(value)) {
return isInverted() ^ true;
}
break;
case ROLE:
if (entry.getRole() == null) {
return isInverted() ^ (value == null);
} else if (entry.getRole().equals(value)) {
return isInverted() ^ true;
}
break;
case EVENTTYPE:
if (EventType.parse(value) == entry.getEventType()) {
return isInverted() ^ true;
}
}
}
return isInverted() ^ false;
}
示例12: getTraceAsString
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public <E extends LogEntry> String getTraceAsString(LogTrace<E> trace) {
StringBuilder builder = new StringBuilder();
builder.append(TRACE_START);
// concept name
builder.append(String.format(ATTRIBUTE_STRING_FORMAT_C, INDENT2, XESExtensions.CONCEPT.prefix + ":name", trace.getCaseNumber(), DEFAULT_LINE_SEPARATOR));
for (LogEntry e : trace.getEntries()) {
builder.append(getEntryAsString(e, trace.getCaseNumber()));
}
builder.append(TRACE_END);
return builder.toString();
}
示例13: getTraceAsString
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public <E extends LogEntry> String getTraceAsString(LogTrace<E> trace) {
StringBuilder builder = new StringBuilder();
builder.append(String.format(INSTANCE_START_FORMAT, trace.getCaseNumber(), DEFAULT_LINE_SEPARATOR));
for (LogEntry e : trace.getEntries()) {
builder.append(getEntryAsString(e, trace.getCaseNumber()));
}
builder.append(INSTANCE_END);
return builder.toString();
}
示例14: getTraceAsString
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
@Override
public <E extends LogEntry> String getTraceAsString(LogTrace<E> trace) {
StringBuilder builder = new StringBuilder();
for(LogEntry e: trace.getEntries()) {
builder.append(getEntryAsString(e, trace.getCaseNumber()));
builder.append(activityDelimiter);
}
builder.append('\n');
return builder.toString();
}
示例15: getSciffTraceList
import de.uni.freiburg.iig.telematik.sewol.log.LogTrace; //导入依赖的package包/类
private void getSciffTraceList(List<LogTrace<LogEntry>> logTraces) {
this.logTraces = new ArrayList<>();
for (LogTrace<LogEntry> trace : logTraces) {
this.logTraces.add(new LogTraceAdapter(trace));
}
}