|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.distance.distancevalue.AbstractDistance<D>
D - the (final) type of Distance usedpublic abstract class AbstractDistance<D extends AbstractDistance<D>>

An abstract distance implements equals conveniently for any extending class.
At the same time any extending class is to implement hashCode properly.
See DistanceUtil for related utility
functions such as min, max.
DistanceUtil,
Serialized Form| Field Summary | |
|---|---|
static Pattern |
DOUBLE_PATTERN
Pattern for parsing and validating double values |
static String |
INFINITY_PATTERN
Indicates an infinity pattern. |
static Pattern |
INTEGER_PATTERN
Pattern for parsing and validating integer values |
| Constructor Summary | |
|---|---|
AbstractDistance()
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Returns true if this == o has the value true or o
is not null and o is of the same class as this instance and
this.compareTo(o) is 0, false otherwise. |
abstract Pattern |
getPattern()
Get the pattern accepted by this distance |
abstract int |
hashCode()
Any extending class should implement a proper hashCode method. |
boolean |
isInfiniteDistance()
Returns true, if the distance is an infinite distance, false otherwise. |
boolean |
isNullDistance()
Returns true, if the distance is a null distance, false otherwise. |
boolean |
isUndefinedDistance()
Returns true, if the distance is an undefined distance, false otherwise. |
String |
requiredInputPattern()
Returns a String as description of the required input format. |
boolean |
testInputPattern(String value)
Test a string value against the input pattern. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancevalue.Distance |
|---|
externalizableSize, infiniteDistance, minus, nullDistance, parseString, plus, toString, undefinedDistance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Field Detail |
|---|
public static final String INFINITY_PATTERN
public static final Pattern DOUBLE_PATTERN
public static final Pattern INTEGER_PATTERN
| Constructor Detail |
|---|
public AbstractDistance()
| Method Detail |
|---|
public abstract int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
this == o has the value true or o
is not null and o is of the same class as this instance and
this.compareTo(o) is 0, false otherwise.
equals in class Objectpublic abstract Pattern getPattern()
public final String requiredInputPattern()
Distance
requiredInputPattern in interface Distance<D extends AbstractDistance<D>>public final boolean testInputPattern(String value)
value - String value to test
public boolean isInfiniteDistance()
Distance
isInfiniteDistance in interface Distance<D extends AbstractDistance<D>>public boolean isNullDistance()
Distance
isNullDistance in interface Distance<D extends AbstractDistance<D>>public boolean isUndefinedDistance()
Distance
isUndefinedDistance in interface Distance<D extends AbstractDistance<D>>
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||