Package elki.distance.external
Class AsciiDistanceParser
- java.lang.Object
-
- elki.distance.external.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AsciiDistanceParser.Par
Parameterization class.-
Nested classes/interfaces inherited from interface elki.distance.external.DistanceParser
DistanceParser.DistanceCacheWriter
-
-
Constructor Summary
Constructors Constructor Description AsciiDistanceParser(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.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
The logger for this class.
-
reader
protected TokenizedReader reader
Tokenized reader.
-
tokenizer
protected Tokenizer tokenizer
Tokenizer.
-
-
Constructor Detail
-
AsciiDistanceParser
public AsciiDistanceParser(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 interfaceDistanceParser
- Parameters:
in
- the stream to parse objects fromcache
- Cache writer
-
-