Class AsciiDistanceParser

  • All Implemented Interfaces:
    DistanceParser

    public class AsciiDistanceParser
    extends java.lang.Object
    implements DistanceParser
    Parser for parsing one distance value per line.

    A line must have the following format: id1 id2 distanceValue, where id1 and id2 are integers starting at 0 representing the two ids belonging to the distance value. Lines starting with "#" will be ignored.

    Since:
    0.1
    Author:
    Elke Achtert, Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static elki.logging.Logging LOG
      The logger for this class.
      protected elki.utilities.io.TokenizedReader reader
      Tokenized reader.
      protected elki.utilities.io.Tokenizer tokenizer
      Tokenizer.
    • Constructor Summary

      Constructors 
      Constructor Description
      AsciiDistanceParser​(elki.datasource.parser.CSVReaderFormat format)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void parse​(java.io.InputStream in, DistanceParser.DistanceCacheWriter cache)
      Returns a list of the objects parsed from the specified input stream and a list of the labels associated with the objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        The logger for this class.
      • reader

        protected elki.utilities.io.TokenizedReader reader
        Tokenized reader.
      • tokenizer

        protected elki.utilities.io.Tokenizer tokenizer
        Tokenizer.
    • Constructor Detail

      • AsciiDistanceParser

        public AsciiDistanceParser​(elki.datasource.parser.CSVReaderFormat format)
        Constructor.
        Parameters:
        format - Input format
    • Method Detail

      • parse

        public void parse​(java.io.InputStream in,
                          DistanceParser.DistanceCacheWriter cache)
        Description copied from interface: DistanceParser
        Returns a list of the objects parsed from the specified input stream and a list of the labels associated with the objects.
        Specified by:
        parse in interface DistanceParser
        Parameters:
        in - the stream to parse objects from
        cache - Cache writer