D
- the (final) type of Distance usedpublic abstract class AbstractDistance<D extends AbstractDistance<D>> extends Object implements Distance<D>
DistanceUtil
for related utility
functions such as min
, max
.DistanceUtil
,
Serialized FormModifier and Type | Field and Description |
---|---|
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 and Description |
---|
AbstractDistance() |
Modifier and Type | Method and Description |
---|---|
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.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
externalizableSize, infiniteDistance, nullDistance, parseString, toString, undefinedDistance
compareTo
readExternal, writeExternal
public static final String INFINITY_PATTERN
public static final Pattern DOUBLE_PATTERN
public static final Pattern INTEGER_PATTERN
public abstract int hashCode()
public 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.public 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 testpublic 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>>