|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpal.util.ThreeNumberSort
public class ThreeNumberSort
sorts three numbers (doubles) and choose randomly among the minimum/maximum values
Field Summary | |
---|---|
int |
first
order of the numbers (0-2) |
double[] |
numbers
the three numbers |
int |
second
order of the numbers (0-2) |
int |
third
order of the numbers (0-2) |
Constructor Summary | |
---|---|
ThreeNumberSort()
constructor |
Method Summary | |
---|---|
int |
getIndexOfLargestNumber()
get input index of largest number |
int |
getIndexOfSmallestNumber()
get input index of smallest number |
double |
getLargestNumber()
get largest number |
double |
getSmallestNumber()
get smallest number |
void |
sort(double n0,
double n1,
double n2)
sort three doubles |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public double[] numbers
public int first
public int second
public int third
Constructor Detail |
---|
public ThreeNumberSort()
Method Detail |
---|
public int getIndexOfLargestNumber()
public int getIndexOfSmallestNumber()
public double getSmallestNumber()
public double getLargestNumber()
public void sort(double n0, double n1, double n2)
n0
- first doublen1
- second doublen2
- third double
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |