|
|
|||||||||||||||||||||
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.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.parser.AbstractParser<ExternalObject>
de.lmu.ifi.dbs.elki.parser.NumberDistanceParser<D>
public class NumberDistanceParser<D extends NumberDistance<D>>
Provides a parser for parsing one distance value per line.
A line must have the follwing format: id1 id2 distanceValue, where id1 and is2 are integers representing the two ids belonging to the distance value. Lines starting with "#" will be ignored.
Field Summary | |
---|---|
static String |
DISTANCE_FUNCTION_D
Description for parameter distance function. |
static String |
DISTANCE_FUNCTION_P
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.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Constructor Summary | |
---|---|
NumberDistanceParser()
Provides a parser for parsing one double distance per line. |
Method Summary | |
---|---|
boolean |
containsKey(Integer id1,
Integer id2,
Map<Integer,Map<Integer,D>> cache)
Returns true if the specified distance cache contains a distance value for the specified ids. |
String |
description()
Returns a description of the class and the required parameters. |
List<AttributeSettings> |
getAttributeSettings()
Returns the parameter setting of the attributes. |
DistanceFunction<ExternalObject,D> |
getDistanceFunction()
Returns the distance function of this parser. |
ParsingResult<ExternalObject> |
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<Integer,Map<Integer,D>> cache)
Puts the specified distance value for the given ids to the distance cache. |
String[] |
setParameters(String[] args)
Sets the attributes of the class accordingly to the given parameters. |
Methods inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
---|
toString, usage |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, getParameters, getPossibleOptions, inlineDescription |
Field Detail |
---|
public static final String DISTANCE_FUNCTION_P
public static final String DISTANCE_FUNCTION_D
private DistanceFunction<ExternalObject,D extends NumberDistance<D>> distanceFunction
Constructor Detail |
---|
public NumberDistanceParser()
Method Detail |
---|
public ParsingResult<ExternalObject> parse(InputStream in)
Parser
parse
in interface Parser<ExternalObject>
in
- the stream to parse objects from
Parser.parse(java.io.InputStream)
public DistanceFunction<ExternalObject,D> getDistanceFunction()
getDistanceFunction
in interface DistanceParser<ExternalObject,D extends NumberDistance<D>>
public String description()
Parameterizable
description
in interface Parameterizable
description
in class AbstractParameterizable
Parameterizable.description()
public String[] setParameters(String[] args) throws ParameterException
Parameterizable
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingParameterizable.setParameters(java.lang.String[])
public List<AttributeSettings> getAttributeSettings()
getAttributeSettings
in interface Parameterizable
getAttributeSettings
in class AbstractParameterizable
Parameterizable.getAttributeSettings()
private void put(Integer id1, Integer id2, D distance, Map<Integer,Map<Integer,D>> cache)
id1
- the first idid2
- the second iddistance
- the distance valuecache
- the distance cachepublic boolean containsKey(Integer id1, Integer id2, Map<Integer,Map<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 |