public class Selected
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
Selected(double prob,
int pos)
Parameters Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object a)
Function to compare objects of the Selected class
Necessary to be able to use "sort" function
It sorts in an increasing order of probability
|
public Selected(double prob, int pos)
Parameters Constructor
prob
- double Probabilitypos
- int Positionpublic int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
a
- Selected object to compare with.