本文整理汇总了Java中org.deckfour.xes.out.XesXmlGZIPSerializer类的典型用法代码示例。如果您正苦于以下问题:Java XesXmlGZIPSerializer类的具体用法?Java XesXmlGZIPSerializer怎么用?Java XesXmlGZIPSerializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XesXmlGZIPSerializer类属于org.deckfour.xes.out包,在下文中一共展示了XesXmlGZIPSerializer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveXESLogIntoGZip
import org.deckfour.xes.out.XesXmlGZIPSerializer; //导入依赖的package包/类
private static void saveXESLogIntoGZip(XLog xlog, String filePath){
//save XES Log
try {
new XesXmlGZIPSerializer().serialize(xlog, new FileOutputStream(new File(filePath)));
} catch (IOException e) {
e.printStackTrace();
}
}
示例2: main
import org.deckfour.xes.out.XesXmlGZIPSerializer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
if (args.length < 3) {
System.err.println("Usage: java " + RandomLogPicker.class.getName() + " <xes-file-in> <number-of-traces> <xes-file-out>");
}
File xesFileIn = new File(args[0]);
int numberOfTraces = Integer.valueOf(args[1]);
File xesFileOut = new File(args[2]);
XesXmlParser parser = new XesXmlParser();
if (!parser.canParse(xesFileIn)) {
parser = new XesXmlGZIPParser();
if (!parser.canParse(xesFileIn)) {
throw new IllegalArgumentException("Unparsable log file: " + xesFileIn.getAbsolutePath());
}
}
List<XLog> xLogs = parser.parse(xesFileIn);
XLog xLog = xLogs.remove(0);
while (xLogs.size() > 0) {
xLog.addAll(xLogs.remove(0));
}
int remainingTraces = xLog.size();
while (remainingTraces > numberOfTraces && remainingTraces > 0) {
Math.floor(Math.random() * remainingTraces);
xLog.remove((int) Math.floor(Math.random() * remainingTraces));
remainingTraces--;
}
OutputStream outStream = new FileOutputStream(xesFileOut);
new XesXmlGZIPSerializer().serialize(xLog, outStream);
}