本文整理匯總了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);
}