⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resultoutputhandler.java

📁 pso源程序
💻 JAVA
字号:
/**
 * 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -