Package elki.result

Class ResultWriter

  • All Implemented Interfaces:
    ResultHandler, ResultProcessor

    @Priority(100)
    public class ResultWriter
    extends java.lang.Object
    implements ResultHandler
    Result handler that feeds the data into a TextWriter.

    Note: these classes need to be rewritten. Contributions welcome!

    Since:
    0.2
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ResultWriter.Par
      Parameterization class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.regex.Pattern filter
      Result filter pattern.
      private boolean gzip
      Whether or not to do gzip compression on output.
      private static Logging LOG
      The logger for this class.
      private java.nio.file.Path out
      Holds the file to print results to.
      private boolean warnoverwrite
      Whether or not to warn on overwrite
    • Constructor Summary

      Constructors 
      Constructor Description
      ResultWriter​(java.nio.file.Path out, boolean gzip, boolean warnoverwrite, java.util.regex.Pattern filter)
      Constructor.
    • Field Detail

      • LOG

        private static final Logging LOG
        The logger for this class.
      • out

        private java.nio.file.Path out
        Holds the file to print results to.
      • gzip

        private boolean gzip
        Whether or not to do gzip compression on output.
      • warnoverwrite

        private boolean warnoverwrite
        Whether or not to warn on overwrite
      • filter

        private java.util.regex.Pattern filter
        Result filter pattern. Optional!
    • Constructor Detail

      • ResultWriter

        public ResultWriter​(java.nio.file.Path out,
                            boolean gzip,
                            boolean warnoverwrite,
                            java.util.regex.Pattern filter)
        Constructor.
        Parameters:
        out - Output file
        gzip - Gzip compression
        warnoverwrite - Warn before overwriting files
        filter - Filter pattern
    • Method Detail

      • processNewResult

        public void processNewResult​(java.lang.Object result)
        Description copied from interface: ResultProcessor
        Process a result.
        Specified by:
        processNewResult in interface ResultProcessor
        Parameters:
        result - Newly added result subtree.
      • openStreamFactory

        private StreamFactory openStreamFactory()
                                         throws java.io.IOException
        Throws:
        java.io.IOException