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


Java LogEntry类代码示例

本文整理汇总了Java中de.uni.freiburg.iig.telematik.sewol.log.LogEntry的典型用法代码示例。如果您正苦于以下问题:Java LogEntry类的具体用法?Java LogEntry怎么用?Java LogEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LogEntry类属于de.uni.freiburg.iig.telematik.sewol.log包,在下文中一共展示了LogEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1:

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
public static <	P extends AbstractPlace<F,S>, 
				T extends AbstractTransition<F,S>, 
				F extends AbstractFlowRelation<P,T,S>, 
				M extends AbstractMarking<S>, 
				S extends Object,
				E extends LogEntry>

	void 

	initiateOverlapCalculation( OverlapCallableGenerator<P,T,F,M,S,E> generator,
								ExecutorListener<OverlapResult<E>> listener)
							
	throws OverlapException {

	ThreadedOverlapCalculator<P,T,F,M,S,E> calculator = new ThreadedOverlapCalculator<P,T,F,M,S,E>(generator);
	calculator.addExecutorListener(listener);
	calculator.runCalculation();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:19,代码来源:Overlap.java

示例2:

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
public static <	P extends AbstractPlace<F,S>, 
				T extends AbstractTransition<F,S>, 
				F extends AbstractFlowRelation<P,T,S>, 
				M extends AbstractMarking<S>, 
				S extends Object,
				E extends LogEntry>

	void 
				
	initiateReplay(	ReplayCallableGenerator<P,T,F,M,S,E> generator,
					ExecutorListener<ReplayResult<E>> listener)
											
	throws ReplayException {

	ThreadedReplayer<P,T,F,M,S,E> calculator = new ThreadedReplayer<P,T,F,M,S,E>(generator);
	calculator.addExecutorListener(listener);
	calculator.runCalculation();
}
 
开发者ID:iig-uni-freiburg,项目名称:SEPIA,代码行数:19,代码来源:Replay.java

示例3: addDataUsage

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
private void addDataUsage(LogEntry entry, Map.Entry<String, XAttribute> attribute) throws ParserException, ParameterException {
	if (!(entry instanceof DULogEntry))
		throw new ParameterException("Cannot add data usage to log entry of type " + entry.getClass().getSimpleName());
	
	String dataAttributeKey = attribute.getKey();
	Object dataAttributeValue = parseAttributeValue(attribute.getValue());
	DataAttribute dataAttribute = new DataAttribute(dataAttributeKey, dataAttributeValue);

	// Get sub-attributes
	for (Map.Entry<String, XAttribute> subattribute : attribute.getValue().getAttributes().entrySet()) {
		String dataAttributeDataUsageString = null;
		if (subattribute.getKey().equals("dataUsage:usage")) {
			dataAttributeDataUsageString = subattribute.getValue().toString();
			List<DataUsage> dataUsageList = parseDataUsageString(dataAttributeDataUsageString);
			for (DataUsage dataUsage : dataUsageList) {
				try {
					((DULogEntry) entry).addDataUsage(dataAttribute, dataUsage);
				} catch (ParameterException | LockingException e) {
					throw new ParserException("Cannot add data usage information to log entry: " + e.getMessage());
				}
			}
		}
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:25,代码来源:XESLogParser.java

示例4: parse

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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

示例5: getLogEntries

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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

示例6: parse

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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

示例7: addName

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
private void addName(LogEntry entry, String value) throws ParserException {
	if (value == null || value.isEmpty())
		throw new ParserException("No value for concept:name");
	try {
		entry.setActivity(value);
	} catch (Exception e) {
		throw new ParserException("Cannot set activity of log entry: " + e.getMessage());
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:10,代码来源:XESLogParser.java

示例8: addOriginator

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
private void addOriginator(LogEntry entry, String value) throws ParserException {
	if (value == null || value.isEmpty())
		throw new ParserException("No value for org:resource");
	try {
		if (entry.getOriginator() == null || !entry.getOriginator().equals(value))
			entry.setOriginator(value);
		entry.setOriginator(value);
	} catch (Exception e) {
		throw new ParserException("Cannot set originator of log entry: " + e.getMessage());
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:12,代码来源:XESLogParser.java

示例9: addRole

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
private void addRole(LogEntry entry, String value) throws ParserException {
	if (value == null || value.isEmpty())
		throw new ParserException("No value for Role");
	try {
		if (entry.getRole() == null || !entry.getRole().equals(value))
			entry.setRole(value);
		entry.setRole(value);
	} catch (LockingException e) {
		throw new ParserException("Cannot set role of log entry: " + e.getMessage());
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:12,代码来源:XESLogParser.java

示例10: addEventType

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
private void addEventType(LogEntry entry, String value) throws ParserException {
	if (value == null || value.isEmpty())
		throw new ParserException("No value for lifecycle:transition");
	EventType eventType = EventType.parse(value);
	if (eventType == null)
		throw new ParserException("Cannot parse event type: " + eventType);
	try {
		entry.setEventType(eventType);
	} catch (Exception e) {
		throw new ParserException("Cannot set event type of log entry: " + e.getMessage());
	}
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:13,代码来源:XESLogParser.java

示例11: getParsedLog

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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

示例12: getSummary

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的package包/类
@Override
public LogSummary<LogEntry> getSummary(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);
        }
        if (index >= summaries.size()) {
                summaries.add(new LogSummary<>(getParsedLog(index)));
        }
        return summaries.get(index);
}
 
开发者ID:iig-uni-freiburg,项目名称:SEWOL,代码行数:15,代码来源:AbstractLogParser.java

示例13: parse

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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

示例14: startElement

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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

示例15: writeTrace

import de.uni.freiburg.iig.telematik.sewol.log.LogEntry; //导入依赖的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


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