resultoutputhandler.java
来自「pso源程序」· Java 代码 · 共 51 行
JAVA
51 行
/**
* Description: provide the capability for handling results
*
* @ Author Create/Modi Note
* Xiaofeng Xie Jul 19, 2006
*/
package maosKernel.infoIO;
import java.io.*;
import Global.system.io.*;
import Global.define.*;
import Global.methods.*;
import maosKernel.infoIO.runtime.*;
import maosKernel.infoIO.screen.*;
public class ResultOutputHandler {
private RandomAccessFile onlineResultFile = null;
public ResultOutputHandler() {
}
public String setResultFile(String tempResultDir, String resultFileName) throws Exception {
new File(tempResultDir).mkdirs();
String outfileName = GlobalFile.getFileLocation(tempResultDir, resultFileName);
onlineResultFile = new RandomAccessFile(outfileName, "rw");
return outfileName;
}
public void writeBodyString(String message) throws Exception {
onlineResultFile.writeBytes(message);
}
public void writeHeadString(String message) throws Exception {
onlineResultFile.writeBytes(GlobalString.addHeadToAllLines(message, MessageTags.MSGTAG_COMMENT)+BasicTag.RETURN_TAG);
}
public void writeResultHeadInfo(CycleResult cycleResult) throws Exception {
writeHeadString(cycleResult.getSpecHeadString()+cycleResult.getFullHeadString("T"));
}
public void writeInitInfo(CycleResult cycleResult) throws Exception {
writeBodyString(cycleResult.getSpecDataLine());
}
public void writeLastInfo(CycleResult cycleResult) throws Exception {
writeBodyString(cycleResult.getFullDataLine()+BasicTag.RETURN_TAG);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?