|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.ranking.NaturalRanking.IntDoublePair
private static class NaturalRanking.IntDoublePair
Represents the position of a double value in an ordering. Comparable interface is implemented so Arrays.sort can be used to sort an array of IntDoublePairs by value. Note that the implicitly defined natural ordering is NOT consistent with equals.
Field Summary | |
---|---|
private int |
position
Original position of the pair |
private double |
value
Value of the pair |
Constructor Summary | |
---|---|
NaturalRanking.IntDoublePair(double value,
int position)
Construct an IntDoublePair with the given value and position. |
Method Summary | |
---|---|
int |
compareTo(NaturalRanking.IntDoublePair other)
Compare this IntDoublePair to another pair. |
int |
getPosition()
Returns the original position of the pair. |
double |
getValue()
Returns the value of the pair. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final double value
private final int position
Constructor Detail |
---|
public NaturalRanking.IntDoublePair(double value, int position)
value
- the value of the pairposition
- the original positionMethod Detail |
---|
public int compareTo(NaturalRanking.IntDoublePair other)
compareTo
in interface java.lang.Comparable<NaturalRanking.IntDoublePair>
other
- the other pair to compare this to
Double.compare(value, other.value)
public double getValue()
public int getPosition()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |