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


Java LogTrace类代码示例

本文整理汇总了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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:18,代码来源:ReplayResult.java

示例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);
        }
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:34,代码来源:MXMLLogParser.java

示例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;
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:31,代码来源:AristaFlowParser.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:10,代码来源:ReplayCallableGenerator.java

示例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());
        }
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:15,代码来源:PetrifyParser.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:12,代码来源:AbstractLogParser.java

示例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);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:10,代码来源:LogParser.java

示例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;
        }
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:38,代码来源:MXMLLogParser.java

示例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));
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:19,代码来源:LogWriter.java

示例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;
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:13,代码来源:TimeFilter.java

示例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;
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:35,代码来源:ContainsFilter.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:15,代码来源:XESLogFormat.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:11,代码来源:MXMLLogFormat.java

示例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();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:11,代码来源:PlainTraceLogFormat.java

示例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));
        }
}
 
开发者ID:iig-uni-freiburg,项目名称:SWAT20,代码行数:7,代码来源:LogParserAdapter.java


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