|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dartra.standard.visitor.ThrowStatisticsVisitor
A game visitor that gathers throw related statistics for a standard game.
Field Summary | |
protected java.util.Hashtable |
playerStats
|
Constructor Summary | |
ThrowStatisticsVisitor(boolean composed)
Create a new throw statistics visitor. |
Method Summary | |
protected int |
countThrowsWhere(Player player,
Condition cond)
Returns the number of throws for given player that comply to given condition. |
double |
getAverageAccuracy(Player player,
boolean includeCalculatedLocations)
Calculate the average accuracy for given player, expressed in centimeters (cm). |
double |
getAverageHorizontalAccuracy(Player player,
boolean includeCalculatedLocations)
Calculate the average horizontal accuracy for given player, expressed in centimeters (cm). |
double |
getAverageVerticalAccuracy(Player player,
boolean includeCalculatedLocations)
Calculate the average vertical accuracy for given player, expressed in centimeters (cm). |
int |
getNrBounceOuts(Player player)
Get the total number of bounce-outs given player had in the game. |
int |
getNrIllegalThrows(Player player)
Get the total number of illegals throws for given player in the game. |
int |
getNrOutOfBounds(Player player)
Get the total number of out-of-bounds throws for given player in the game. |
int |
getNrThrows(Player player)
Get the total number of throws for given player in the game. |
int |
getNrThrowsIn(Player player)
Get the total number of throws for given player in the game that were in, that is: not out-of-bounds. |
int |
getNrTurns(Player player)
Get the total number of turns for given player in the game. |
int |
getNrZoneHits(Player player,
Zone zone)
Get the total number of times the given player hit specified zone during the game. |
int |
getTotalNrThrows()
Get the total number of throws in the game. |
int |
getTotalNrTurns()
Get the total number of turns in the game. |
double |
getZoneAccuracyPercentage(Player player)
Get the zone accuracy for given player in the game. |
double |
getZonePercentage(Player player,
Zone zone)
Get the percentage of the throws for given player that hit given zone. |
boolean |
isComposed()
Returns whether or not this visitor composes match data. |
void |
visitGame(Game game)
Process game data. |
void |
visitMatch(Match match)
Process match data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Hashtable playerStats
Constructor Detail |
public ThrowStatisticsVisitor(boolean composed)
Create a new throw statistics visitor. When composed is set, all the data for all the games in a match will be composed. When not set, only the data directly related to the match will be processed.
Method Detail |
public boolean isComposed()
Returns whether or not this visitor composes match data.
public void visitGame(Game game)
GameVisitor
Process game data.
visitGame
in interface GameVisitor
public void visitMatch(Match match)
GameVisitor
Process match data.
visitMatch
in interface GameVisitor
protected int countThrowsWhere(Player player, Condition cond)
Returns the number of throws for given player that comply to given condition.
public int getTotalNrTurns()
Get the total number of turns in the game.
public int getTotalNrThrows()
Get the total number of throws in the game.
public int getNrTurns(Player player)
Get the total number of turns for given player in the game.
public int getNrThrows(Player player)
Get the total number of throws for given player in the game.
public int getNrThrowsIn(Player player)
Get the total number of throws for given player in the game that were in, that is: not out-of-bounds.
public int getNrIllegalThrows(Player player)
Get the total number of illegals throws for given player in the game.
public int getNrOutOfBounds(Player player)
Get the total number of out-of-bounds throws for given player in the game.
public int getNrBounceOuts(Player player)
Get the total number of bounce-outs given player had in the game.
public int getNrZoneHits(Player player, Zone zone)
Get the total number of times the given player hit specified zone during the game.
public double getZoneAccuracyPercentage(Player player)
Get the zone accuracy for given player in the game. This is the percentage of times the player hit the zone that he targetted.
public double getZonePercentage(Player player, Zone zone)
Get the percentage of the throws for given player that hit given zone. For instance, if half of the player's throws were targetted at given zone, 50.0 % would be the result.
public double getAverageHorizontalAccuracy(Player player, boolean includeCalculatedLocations)
Calculate the average horizontal accuracy for given player, expressed in centimeters (cm).
includeCalculatedLocations
- If not set, hits with calculated locations will
not be taken into account.public double getAverageVerticalAccuracy(Player player, boolean includeCalculatedLocations)
Calculate the average vertical accuracy for given player, expressed in centimeters (cm).
includeCalculatedLocations
- If not set, hits with calculated locations will
not be taken into account.public double getAverageAccuracy(Player player, boolean includeCalculatedLocations)
Calculate the average accuracy for given player, expressed in centimeters (cm). This indicates how for on average the player throws from the targetted location.
includeCalculatedLocations
- If not set, hits with calculated locations will
not be taken into account.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |