Examples of TextWriter


Examples of com.elondra.rp.TextWriter

    protected void write( final Map consolidated )
            throws PackException
    {
        if( mode == null || !mode.equalsIgnoreCase( "binary" ) )
        {
            final TextWriter writer = new TextWriter();
            writer.setOut( out );
            writer.write( consolidated );
        }
        else
        {
            final ResourceWriter writer = new BinaryWriter();
            writer.setOut( out );
            writer.setOrder( order );
            writer.write( consolidated );
        }
    }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.result.textwriter.TextWriter

    this.warnoverwrite = warnoverwrite;
  }

  @Override
  public void processNewResult(HierarchicalResult baseresult, Result result) {
    TextWriter writer = new TextWriter();

    StreamFactory output;
    try {
      if(out == null) {
        output = new SingleStreamOutput(gzip);
      }
      else if(out.exists()) {
        if(out.isDirectory()) {
          if(warnoverwrite && out.listFiles().length > 0) {
            logger.warning("Output directory specified is not empty. Files will be overwritten and old files may be left over.");
          }
          output = new MultipleFilesOutput(out, gzip);
        }
        else {
          if(warnoverwrite) {
            logger.warning("Output file exists and will be overwritten!");
          }
          output = new SingleStreamOutput(out, gzip);
        }
      }
      else {
        // If it doesn't exist yet, make a MultipleFilesOutput.
        output = new MultipleFilesOutput(out, gzip);
      }
    }
    catch(IOException e) {
      throw new IllegalStateException("Error opening output.", e);
    }
    try {
      Database db = ResultUtil.findDatabase(baseresult);
      writer.output(db, result, output);
    }
    catch(IOException e) {
      throw new IllegalStateException("Input/Output error while writing result.", e);
    }
    catch(UnableToComplyException e) {
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.result.textwriter.TextWriter

    this.warnoverwrite = warnoverwrite;
  }

  @Override
  public void processNewResult(HierarchicalResult baseresult, Result result) {
    TextWriter writer = new TextWriter();

    StreamFactory output;
    try {
      if(out == null) {
        output = new SingleStreamOutput(gzip);
      }
      else if(out.exists()) {
        if(out.isDirectory()) {
          if(warnoverwrite && out.listFiles().length > 0) {
            logger.warning("Output directory specified is not empty. Files will be overwritten and old files may be left over.");
          }
          output = new MultipleFilesOutput(out, gzip);
        }
        else {
          if(warnoverwrite) {
            logger.warning("Output file exists and will be overwritten!");
          }
          output = new SingleStreamOutput(out, gzip);
        }
      }
      else {
        // If it doesn't exist yet, make a MultipleFilesOutput.
        output = new MultipleFilesOutput(out, gzip);
      }
    }
    catch(IOException e) {
      throw new IllegalStateException("Error opening output.", e);
    }
    try {
      Database db = ResultUtil.findDatabase(baseresult);
      writer.output(db, result, output);
    }
    catch(IOException e) {
      throw new IllegalStateException("Input/Output error while writing result.", e);
    }
    catch(UnableToComplyException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.