|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.autonomy.utilities.League
This class maintains a list of objects and scores. Scores can be added and subtracted
and at any point a Vector of entries sorted by score can be returned.
Also 'spare' data can be associated with eache league key.
Field Summary | |
java.util.Vector |
m_vLeague
|
Constructor Summary | |
League()
Create an empty league structure |
|
League(java.util.Hashtable htIn)
Create a league structure from an existing Hashtable. |
Method Summary | |
boolean |
add(com.autonomy.utilities.LeagueEntry entry)
Add to the league the given LeagueEntry |
boolean |
add(java.lang.String sName,
int nScore)
Add nScore to sNames points total |
void |
addSpareData(java.lang.String sKey,
java.lang.String sName,
java.lang.Object oToAdd)
Adds to the repository for spare data. |
void |
display()
Writes the league to stdout |
java.util.Hashtable |
getHashtable()
Returns the hashtable object |
int |
getScore(java.lang.String sName)
Returns the current score in the league for sName A return value of -1 means there is no entry called sName in the league |
java.lang.Object |
getSpareData(java.lang.String sKey,
java.lang.String sName)
Retrieves spare data |
java.util.Vector |
makeLeagueTable()
The returned vector is a list of entries in the league, sorted by score. |
java.util.Vector |
makeLeagueTable(java.lang.String sSpareKey)
The returned vector is a list of entries in the league, sorted by score. |
void |
setMaxScore(int nMaxScore)
Sets a maximum score acheivable in the league Non-positive scores are ignored |
boolean |
subtract(com.autonomy.utilities.LeagueEntry entry)
Subtract from the league the given LeagueEntry |
boolean |
subtract(java.lang.String sName,
int nScore)
subtract nScore from sNames points total |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.util.Vector m_vLeague
Constructor Detail |
public League()
public League(java.util.Hashtable htIn)
Method Detail |
public boolean add(java.lang.String sName, int nScore)
public boolean add(com.autonomy.utilities.LeagueEntry entry)
public boolean subtract(com.autonomy.utilities.LeagueEntry entry)
public boolean subtract(java.lang.String sName, int nScore)
public int getScore(java.lang.String sName)
public void setMaxScore(int nMaxScore)
public java.util.Vector makeLeagueTable()
public java.util.Vector makeLeagueTable(java.lang.String sSpareKey)
public void display()
public java.util.Hashtable getHashtable()
public void addSpareData(java.lang.String sKey, java.lang.String sName, java.lang.Object oToAdd)
sKey
- Name of spare data repositorysName
- name of the league entry to which the data belongsoToAdd
- Object to addpublic java.lang.Object getSpareData(java.lang.String sKey, java.lang.String sName)
sKey
- Name of spare data repositorysName
- name of the league entry to which the data belongs
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |