Class Competition

java.lang.Object
  extended by Competition

public class Competition
extends Object

Creates and manages an array of objects of type MazeResult.

Version:
Summer 2014
Author:
Tina Comston

Field Summary
static int ALL
          Constant containing value for ALL.
static int FEMALE
          Constant containing value for FEMALE.
static int MALE
          Constant containing value for MALE.
static int NOT_VACCINATED
          Constant containing value for NOT_VACCINATED.
static int VACCINATED
          Constant containing value for VACCINATED.
 
Constructor Summary
Competition(String inDesc)
          Constructor for objects of class Competition.
 
Method Summary
 void addMazeResult(MazeResult inMazeResult)
          add a MazeResult object to the array.
 int getCount()
          get the count of populated elements in the array.
 String getDesc()
          get the competition description.
 MazeResult getMazeResult(int inIndex)
          get a MazeResult object from the array.
 MazeResult getMazeResult(String inRFID)
          get a MazeResult object from the array.
 double getRatAveTime(int inCategory)
          get the average ACTUAL time of rats for a given category.
 int getRatCount(int inCategory)
          get the count of rats for a given category.
 boolean isCategoryMatch(int inCategory, Rat inRat)
          determine if the category matches condition.
 void setDesc(String inDesc)
          set the competition description.
 String toString()
          get a formatted string with information about a competition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
Constant containing value for ALL.

See Also:
Constant Field Values

FEMALE

public static final int FEMALE
Constant containing value for FEMALE.

See Also:
Constant Field Values

MALE

public static final int MALE
Constant containing value for MALE.

See Also:
Constant Field Values

NOT_VACCINATED

public static final int NOT_VACCINATED
Constant containing value for NOT_VACCINATED.

See Also:
Constant Field Values

VACCINATED

public static final int VACCINATED
Constant containing value for VACCINATED.

See Also:
Constant Field Values
Constructor Detail

Competition

public Competition(String inDesc)
Constructor for objects of class Competition.

Parameters:
inDesc - The competition description.
Method Detail

addMazeResult

public void addMazeResult(MazeResult inMazeResult)
add a MazeResult object to the array.

Parameters:
inMazeResult - The MazeResult object.

getCount

public int getCount()
get the count of populated elements in the array.

Returns:
int The count of populated elements; also indicates the next available element position.

getDesc

public String getDesc()
get the competition description.

Returns:
String The competition description.

getMazeResult

public MazeResult getMazeResult(int inIndex)
get a MazeResult object from the array.

Parameters:
inIndex - The array index position of the requested object.
Returns:
MazeResult The MazeResult object from the array, returns null if index not found or invalid.

getMazeResult

public MazeResult getMazeResult(String inRFID)
get a MazeResult object from the array.

Parameters:
inRFID - The Rats RFID in the requested object.
Returns:
MazeResult The MazeResult object from the array, if not found returns null.

getRatAveTime

public double getRatAveTime(int inCategory)
get the average ACTUAL time of rats for a given category.

Parameters:
inCategory - Numeric value representing a race category.
Returns:
double The average time in maze in seconds.

getRatCount

public int getRatCount(int inCategory)
get the count of rats for a given category.

Parameters:
inCategory - Numeric value representing a rat category.
Returns:
int The count of rats.

isCategoryMatch

public boolean isCategoryMatch(int inCategory,
                               Rat inRat)
determine if the category matches condition.

Parameters:
inCategory - Numeric value representing a result category.
inRat - Rat object with associated attributes.
Returns:
boolean Boolean result of category check.

setDesc

public void setDesc(String inDesc)
set the competition description.

Parameters:
inDesc - The competition description.

toString

public String toString()
get a formatted string with information about a competition.

Overrides:
toString in class Object
Returns:
String String with information about a competition.