D
- distance typepublic abstract class CorrelationDistance<D extends CorrelationDistance<D>> extends AbstractDistance<D>
Modifier and Type | Field and Description |
---|---|
static Pattern |
CORRELATION_DISTANCE_PATTERN
The pattern used for correlation distances
|
protected int |
correlationValue
The correlation dimension.
|
protected double |
euclideanValue
The euclidean distance.
|
static String |
SEPARATOR
The component separator used by correlation distances.
|
private static long |
serialVersionUID
Generated SerialVersionUID.
|
DOUBLE_PATTERN, INFINITY_PATTERN, INTEGER_PATTERN
Constructor and Description |
---|
CorrelationDistance()
Empty constructor for serialization purposes.
|
CorrelationDistance(int correlationValue,
double euclideanValue)
Constructs a new CorrelationDistance object consisting of the specified
correlation value and euclidean value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(D other)
Compares this CorrelationDistance with the given CorrelationDistance wrt
the represented correlation values.
|
boolean |
equals(Object obj)
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. |
int |
externalizableSize()
Returns the number of Bytes this distance uses if it is written to an
external file.
|
int |
getCorrelationValue()
Returns the correlation dimension between the objects.
|
double |
getEuclideanValue()
Returns the euclidean distance between the objects.
|
int |
hashCode()
Any extending class should implement a proper hashCode method.
|
void |
readExternal(ObjectInput in)
Reads the correlation value and the euclidean value of this
CorrelationDistance from the specified stream.
|
String |
toString()
Returns a string representation of this CorrelationDistance.
|
void |
writeExternal(ObjectOutput out)
Writes the correlation value and the euclidean value of this
CorrelationDistance to the specified stream.
|
getPattern, isInfiniteDistance, isNullDistance, isUndefinedDistance, requiredInputPattern, testInputPattern
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
infiniteDistance, nullDistance, parseString, undefinedDistance
public static final String SEPARATOR
public static final Pattern CORRELATION_DISTANCE_PATTERN
private static final long serialVersionUID
protected int correlationValue
protected double euclideanValue
public CorrelationDistance()
public CorrelationDistance(int correlationValue, double euclideanValue)
correlationValue
- the correlation dimension to be represented by the
CorrelationDistanceeuclideanValue
- the euclidean distance to be represented by the
CorrelationDistancepublic String toString()
public int compareTo(D other)
Integer.compareTo(Integer)
this.correlationValue.compareTo(other.correlationValue)} if it is a
non zero value, the value of Double.compare(this.euclideanValue, other.euclideanValue)
otherwisepublic int hashCode()
AbstractDistance
hashCode
in class AbstractDistance<D extends CorrelationDistance<D>>
public boolean equals(Object obj)
AbstractDistance
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 AbstractDistance<D extends CorrelationDistance<D>>
public int getCorrelationValue()
public double getEuclideanValue()
public void writeExternal(ObjectOutput out) throws IOException
IOException
public void readExternal(ObjectInput in) throws IOException
IOException
public int externalizableSize()