|
Spring Data Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.geo.Distance
public class Distance
Value object to represent distances in a given metric.
| Constructor Summary | |
|---|---|
Distance(double value)
Creates a new Distance with a neutral metric. |
|
Distance(double value,
Metric metric)
Creates a new Distance with the given Metric. |
|
| Method Summary | |
|---|---|
Distance |
add(Distance other)
Adds the given distance to the current one. |
Distance |
add(Distance other,
Metric metric)
Adds the given Distance to the current one and forces the result to be in a given Metric. |
boolean |
equals(Object obj)
|
Metric |
getMetric()
Retruns the Metric of the Distance. |
double |
getNormalizedValue()
Returns the normalized value regarding the underlying Metric. |
double |
getValue()
Returns the distance value in the current Metric. |
int |
hashCode()
|
Distance |
in(Metric metric)
Returns a new Distance in the given Metric. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Distance(double value)
Distance with a neutral metric. This means the provided value needs to be in normalized form.
value -
public Distance(double value,
Metric metric)
Distance with the given Metric.
value - metric - can be null.| Method Detail |
|---|
public double getValue()
Metric.
public double getNormalizedValue()
Metric.
public Metric getMetric()
Metric of the Distance.
public Distance add(Distance other)
Distance will be in the same metric as the
current one.
other - must not be null.
public Distance add(Distance other,
Metric metric)
Distance to the current one and forces the result to be in a given Metric.
other - must not be null.metric - must not be null.
public Distance in(Metric metric)
Distance in the given Metric. This means that the returned instance will have the
same normalized value as the original instance.
metric - must not be null.
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
Spring Data Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||