|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpal.algorithmics.Ranker
public class Ranker
Title: Ranker Description: Maintains a list of ranked objects
| Constructor Summary | |
|---|---|
Ranker(int maximumSize)
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object object,
double score,
boolean maximising)
Add in (if it's good enough) a new object based on a score If an object has equality with an object already in the store that object is replaced by the new version |
java.lang.Object |
getBestObject()
|
double |
getBestScore()
Obtain the best score which may be the highest score (if maximising), or the lowest score (if minimising) |
java.lang.Object[] |
getObjects()
Obtain the objects in this ranker |
boolean |
isWorthAdding(double score,
boolean maximising)
Enquire to the merits of adding an object with a particular score |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Ranker(int maximumSize)
| Method Detail |
|---|
public final java.lang.Object getBestObject()
public final double getBestScore()
public final boolean isWorthAdding(double score,
boolean maximising)
score - The score in question
public final java.lang.Object[] getObjects()
public void add(java.lang.Object object,
double score,
boolean maximising)
object - The object to add inscore - The score of the objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||