|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.parser.AbstractParser<ExternalObject>
de.lmu.ifi.dbs.elki.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.
Field Summary | |
---|---|
static OptionID |
DISTANCE_FUNCTION_ID
OptionID for DISTANCE_FUNCTION_PARAM |
private ObjectParameter<DistanceFunction<ExternalObject,D>> |
DISTANCE_FUNCTION_PARAM
Parameter for distance function. |
private DistanceFunction<ExternalObject,D> |
distanceFunction
The distance function. |
Fields inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
---|
ATTRIBUTE_CONCATENATION, COMMENT, WHITESPACE_PATTERN |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
NumberDistanceParser(Parameterization config)
Constructor, adhering to Parameterizable |
Method Summary | |
---|---|
boolean |
containsKey(Integer id1,
Integer id2,
Map<Pair<Integer,Integer>,D> cache)
Returns true if the specified distance cache contains a distance value for the specified ids. |
DistanceFunction<ExternalObject,D> |
getDistanceFunction()
Returns the distance function of this parser. |
DistanceParsingResult<ExternalObject,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(Integer id1,
Integer id2,
D distance,
Map<Pair<Integer,Integer>,D> cache)
Puts the specified distance value for the given ids to the distance cache. |
Methods inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
---|
toString |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final OptionID DISTANCE_FUNCTION_ID
DISTANCE_FUNCTION_PARAM
private ObjectParameter<DistanceFunction<ExternalObject,D extends NumberDistance<D,N>>> DISTANCE_FUNCTION_PARAM
private DistanceFunction<ExternalObject,D extends NumberDistance<D,N>> distanceFunction
Constructor Detail |
---|
public NumberDistanceParser(Parameterization config)
Parameterizable
config
- ParameterizationMethod Detail |
---|
public DistanceParsingResult<ExternalObject,D> parse(InputStream in)
DistanceParser
parse
in interface DistanceParser<ExternalObject,D extends NumberDistance<D,N>>
parse
in interface Parser<ExternalObject>
in
- the stream to parse objects from
public DistanceFunction<ExternalObject,D> getDistanceFunction()
getDistanceFunction
in interface DistanceParser<ExternalObject,D extends NumberDistance<D,N>>
private void put(Integer id1, Integer id2, D distance, Map<Pair<Integer,Integer>,D> cache)
id1
- the first idid2
- the second iddistance
- the distance valuecache
- the distance cachepublic boolean containsKey(Integer id1, Integer id2, Map<Pair<Integer,Integer>,D> cache)
id1
- the first idid2
- the second idcache
- the distance cache
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |