當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。