|
|
|||||||||||||||||||||
| 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,N>
D - distance typeN - number typepublic 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 |
(package private) ClassParameter<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.utilities.optionhandling.AbstractParameterizable |
|---|
optionHandler |
| Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debug, logger |
| Constructor Summary | |
|---|---|
NumberDistanceParser()
Provides a parser for parsing one double distance per line. |
|
| 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. |
List<String> |
setParameters(List<String> args)
Grabs all specified options from the option handler. |
String |
shortDescription()
Returns a short description of the class. |
| Methods inherited from class de.lmu.ifi.dbs.elki.parser.AbstractParser |
|---|
toString |
| Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
|---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable |
| 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 |
| Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
|---|
checkGlobalParameterConstraints, collectOptions, getParameters |
| Field Detail |
|---|
public static final OptionID DISTANCE_FUNCTION_ID
DISTANCE_FUNCTION_PARAM
ClassParameter<DistanceFunction<ExternalObject,D extends NumberDistance<D,N>>> DISTANCE_FUNCTION_PARAM
private DistanceFunction<ExternalObject,D extends NumberDistance<D,N>> distanceFunction
| Constructor Detail |
|---|
public NumberDistanceParser()
| Method 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>>public String shortDescription()
AbstractParameterizable
shortDescription in interface ParameterizableshortDescription in class AbstractParameterizable
public List<String> setParameters(List<String> args)
throws ParameterException
AbstractParameterizable
{
List remainingParameters = super.setParameters(args);
// set parameters for your class
// for example like this:
if(isSet(MY_PARAM_VALUE_PARAM))
{
myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM);
}
.
.
.
return remainingParameters;
// or in case of attributes requesting parameters themselves
// return parameterizableAttribbute.setParameters(remainingParameters);
}
setParameters in interface ParameterizablesetParameters in class AbstractParameterizableargs - parameters to set the attributes accordingly to
ParameterException - in case of wrong parameter-setting
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 cache
public 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 | |||||||||||