|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.debug.Debug | +--org.moyoman.debug.GroupRating
This class allows stones to be put into groups, and each group given a rating of between 0 and 1. Examples of the ratings would include the life and death status of the group, and how important the group is, where 1.0 would indicate an important group, and 0.0 would indicate that the group should be sacrificed.
Field Summary | |
private float[] |
ratings
Each rating corresponds to the corresponding element in stones. |
private ArrayList |
stones
Each element is an ArrayList containing Stone objects. |
Fields inherited from class org.moyoman.debug.Debug |
|
Constructor Summary | |
GroupRating(String h)
Create the GroupRating object. |
Method Summary | |
int |
addGroup(Stone[] st,
float rating)
Add a groupt of stones with a rating. |
float |
getRating(int group)
Get the rating for the group. |
Stone[] |
getStones(int group)
Get the stones associated with a particular group. |
int |
getTotalGroups()
Get the total number of groups. |
DebugType |
getType()
Get the debug type. |
static void |
main(String[] args)
This method is used for unit testing. |
String |
toString()
Get a String representation of the object. |
Methods inherited from class org.moyoman.debug.Debug |
getHeaderType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private ArrayList stones
private float[] ratings
Constructor Detail |
public GroupRating(String h)
h
- The header.Method Detail |
public static void main(String[] args)
public int addGroup(Stone[] st, float rating)
st
- The stones in the group.rating
- The rating of that group.
public Stone[] getStones(int group) throws IndexOutOfBoundsException
group
- The number of the group.
IndexOutOfBoundsException
- Thrown if the group
parameter is invalid.public float getRating(int group) throws IndexOutOfBoundsException
group
- - The number of the group.
IndexOutOfBoundsException
- Thrown if the group
parameter is invalid.public int getTotalGroups()
public String toString()
toString
in class Object
public DebugType getType()
getType
in class Debug
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |