|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser de.lmu.ifi.dbs.elki.datasource.parser.NumberDistanceParser<D,N>
D
- distance typeN
- number type@Title(value="Number Distance Parser") @Description(value="Parser for the following line format:\nid1 id2 distanceValue, where id1 and is2 are integers representing the two ids belonging to the distance value.\n The ids and the distance value are separated by whitespace. Empty lines and lines beginning with \"#\" will be ignored.") public class NumberDistanceParser<D extends NumberDistance<D,N>,N extends Number>
Provides a parser for parsing one distance value per line.
A line must have the following format: id1 id2 distanceValue, where id1 and id2 are integers representing the two ids belonging to the distance value. Lines starting with "#" will be ignored.
Nested Class Summary | |
---|---|
static class |
NumberDistanceParser.Parameterizer<D extends NumberDistance<D,N>,N extends Number>
Parameterization class. |
Field Summary | |
---|---|
static OptionID |
DISTANCE_FUNCTION_ID
Parameter for distance function. |
private DistanceFunction<?,D> |
distanceFunction
The distance function. |
private static Logging |
logger
The logger for this class. |
Fields inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser |
---|
ATTRIBUTE_CONCATENATION, COLUMN_SEPARATOR_ID, COMMENT, NUMBER_PATTERN, QUOTE_CHAR, QUOTE_ID, quoteChar, WHITESPACE_PATTERN |
Constructor Summary | |
---|---|
NumberDistanceParser(Pattern colSep,
char quoteChar,
DistanceFunction<?,D> distanceFunction)
Constructor. |
Method Summary | |
---|---|
boolean |
containsKey(DBID id1,
DBID id2,
Map<DBIDPair,D> cache)
Returns true if the specified distance cache contains a distance value for the specified ids. |
protected Logging |
getLogger()
Get the logger for this class. |
DistanceParsingResult<D> |
parse(InputStream in)
Returns a list of the objects parsed from the specified input stream and a list of the labels associated with the objects. |
private void |
put(DBID id1,
DBID id2,
D distance,
Map<DBIDPair,D> cache)
Puts the specified distance value for the given ids to the distance cache. |
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser |
---|
tokenize, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final Logging logger
public static final OptionID DISTANCE_FUNCTION_ID
private DistanceFunction<?,D extends NumberDistance<D,N>> distanceFunction
Constructor Detail |
---|
public NumberDistanceParser(Pattern colSep, char quoteChar, DistanceFunction<?,D> distanceFunction)
colSep
- quoteChar
- distanceFunction
- Method Detail |
---|
public DistanceParsingResult<D> parse(InputStream in)
DistanceParser
parse
in interface DistanceParser<D extends NumberDistance<D,N>>
in
- the stream to parse objects from
private void put(DBID id1, DBID id2, D distance, Map<DBIDPair,D> cache)
id1
- the first idid2
- the second iddistance
- the distance valuecache
- the distance cachepublic boolean containsKey(DBID id1, DBID id2, Map<DBIDPair,D> cache)
id1
- the first idid2
- the second idcache
- the distance cache
protected Logging getLogger()
AbstractParser
getLogger
in class AbstractParser
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |