Package marauroa.server.game
Class Statistics
java.lang.Object
marauroa.server.game.Statistics
- All Implemented Interfaces:
StatisticsMBean
This class encapsulate everything related to the statistics recollection and
storage.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This class is very similar to a Mapwith the extra that adds some comodity methods like: add print -
Field Summary
Modifier and TypeFieldDescriptionstatic int
time between statistics dumps -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an attribute to its existinglong
Return the value of an attribute since the server start.static Statistics
Returns an unique instance of Statistics.void
print()
Print to $statistics_filename file the content of the statistics object.void
Sets an attribute
-
Field Details
-
DATABASE_STATISTICS_LAPSUS
public static final int DATABASE_STATISTICS_LAPSUStime between statistics dumps- See Also:
- Constant Field Values
-
-
Method Details
-
getStatistics
Returns an unique instance of Statistics. This is a singleton.- Returns:
- a statistics object
-
set
Sets an attribute- Parameters:
type
- attribute namevalue
- its value
-
add
Adds an attribute to its existing- Parameters:
type
-value
-
-
get
Return the value of an attribute since the server start. This method is used by the Bean interface.- Specified by:
get
in interfaceStatisticsMBean
- Parameters:
type
- the attribute name- Returns:
- value
-
print
public void print()Print to $statistics_filename file the content of the statistics object.
-