com.planet_ink.coffee_mud.Common
Class DefaultCoffeeTableRow

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultCoffeeTableRow
All Implemented Interfaces:
CMCommon, CoffeeTableRow, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultCoffeeTableRow
extends java.lang.Object
implements CoffeeTableRow


Field Summary
 long endTime
           
 long highestOnline
           
 long numberOnlineCounter
           
 long numberOnlineTotal
           
 long startTime
           
 java.util.Map<java.lang.String,long[]> stats
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CoffeeTableRow
STAT_BIRTHS, STAT_CLASSCHANGE, STAT_DEATHS, STAT_DIVORCES, STAT_LEVELSGAINED, STAT_LOGINS, STAT_MARRIAGES, STAT_NEWPLAYERS, STAT_PKDEATHS, STAT_PURGES, STAT_QUESTACCEPTED, STAT_QUESTDROPPED, STAT_QUESTFAILED, STAT_QUESTFAILEDSTART, STAT_QUESTSTARTATTEMPT, STAT_QUESTSTOP, STAT_QUESTSUCCESS, STAT_QUESTTIMESTART, STAT_QUESTTIMESTOP, STAT_SKILLUSE, STAT_SPECIAL_NUMONLINE, STAT_TICKSONLINE, STAT_TOTAL
 
Constructor Summary
DefaultCoffeeTableRow()
           
 
Method Summary
 void bumpVal(CMObject E, int type)
          Gathers relevant information about the given Environmental object (usually MOB or Ability) and adds to the relevant statistics.
 void bumpVal(java.lang.String s, int type)
          Finds a named statistic of the given name, and increments the value of that long statistic by 1.
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 java.lang.String data()
          Returns an XML document representing all the information in this object.
 long endTime()
          The end time, in millis since 1970, for this row of data
 long highestOnline()
          Returns the highest number of players online during this period.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 long numberOnlineCounter()
          Returns the number of times the number of players online has been polled during this period.
 long numberOnlineTotal()
          Returns the cumulative number online during this period per poll.
 void populate(long start, long end, java.lang.String data)
          Populates this object from an xml document containing relevant statistics.
 void setEndTime(long time)
          Sets the end time, in millis since 1970, for this row of data
 void setStartTime(long time)
          Sets the start time, in millis since 1970, for this row of data
 long startTime()
          The start time, in millis since 1970, for this row of data
 java.lang.String tagFix(java.lang.String s)
          Simple method that replaces a strings spaces with _ characters, and makes the string uppercase.
 void totalUp(java.lang.String code, long[] tot)
          Loops through adding all the event stats for the given code string together
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stats

public java.util.Map<java.lang.String,long[]> stats

highestOnline

public long highestOnline

numberOnlineTotal

public long numberOnlineTotal

numberOnlineCounter

public long numberOnlineCounter

startTime

public long startTime

endTime

public long endTime
Constructor Detail

DefaultCoffeeTableRow

public DefaultCoffeeTableRow()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

setStartTime

public void setStartTime(long time)
Description copied from interface: CoffeeTableRow
Sets the start time, in millis since 1970, for this row of data

Specified by:
setStartTime in interface CoffeeTableRow
Parameters:
time - the start time in millis
See Also:
CoffeeTableRow.startTime()

setEndTime

public void setEndTime(long time)
Description copied from interface: CoffeeTableRow
Sets the end time, in millis since 1970, for this row of data

Specified by:
setEndTime in interface CoffeeTableRow
Parameters:
time - the end time in millis
See Also:
CoffeeTableRow.endTime()

startTime

public long startTime()
Description copied from interface: CoffeeTableRow
The start time, in millis since 1970, for this row of data

Specified by:
startTime in interface CoffeeTableRow
Returns:
the start time in millis
See Also:
CoffeeTableRow.setStartTime(long)

endTime

public long endTime()
Description copied from interface: CoffeeTableRow
The end time, in millis since 1970, for this row of data

Specified by:
endTime in interface CoffeeTableRow
Returns:
the end time in millis
See Also:
CoffeeTableRow.setEndTime(long)

highestOnline

public long highestOnline()
Description copied from interface: CoffeeTableRow
Returns the highest number of players online during this period.

Specified by:
highestOnline in interface CoffeeTableRow
Returns:
the highest number of players online

numberOnlineTotal

public long numberOnlineTotal()
Description copied from interface: CoffeeTableRow
Returns the cumulative number online during this period per poll. Used to calulate the avg online for the period.

Specified by:
numberOnlineTotal in interface CoffeeTableRow
Returns:
the cumulative number online during this period per poll
See Also:
CoffeeTableRow.numberOnlineCounter()

numberOnlineCounter

public long numberOnlineCounter()
Description copied from interface: CoffeeTableRow
Returns the number of times the number of players online has been polled during this period.

Specified by:
numberOnlineCounter in interface CoffeeTableRow
Returns:
number of times the number of players online has been polled
See Also:
CoffeeTableRow.numberOnlineTotal()

data

public java.lang.String data()
Description copied from interface: CoffeeTableRow
Returns an XML document representing all the information in this object.

Specified by:
data in interface CoffeeTableRow
Returns:
an xml document
See Also:
CoffeeTableRow.populate(long, long, String)

bumpVal

public void bumpVal(java.lang.String s,
                    int type)
Description copied from interface: CoffeeTableRow
Finds a named statistic of the given name, and increments the value of that long statistic by 1. Requires the event being recorded.

Specified by:
bumpVal in interface CoffeeTableRow
Parameters:
s - the named statistic to record for the given event
type - the type of event to tabulate
See Also:
CoffeeTableRow.STAT_LOGINS

totalUp

public void totalUp(java.lang.String code,
                    long[] tot)
Description copied from interface: CoffeeTableRow
Loops through adding all the event stats for the given code string together

Specified by:
totalUp in interface CoffeeTableRow
Parameters:
code - the code string to use, or *
tot - the running total of all events stats
See Also:
CoffeeTableRow.STAT_TOTAL

tagFix

public java.lang.String tagFix(java.lang.String s)
Description copied from interface: CoffeeTableRow
Simple method that replaces a strings spaces with _ characters, and makes the string uppercase.

Specified by:
tagFix in interface CoffeeTableRow
Parameters:
s - the string to change
Returns:
the changed string

bumpVal

public void bumpVal(CMObject E,
                    int type)
Description copied from interface: CoffeeTableRow
Gathers relevant information about the given Environmental object (usually MOB or Ability) and adds to the relevant statistics. Requires the Environmental object to query, and the event being recorded.

Specified by:
bumpVal in interface CoffeeTableRow
Parameters:
E - the mob or ability
type - the type of event to tabulate
See Also:
CoffeeTableRow.STAT_LOGINS

populate

public void populate(long start,
                     long end,
                     java.lang.String data)
Description copied from interface: CoffeeTableRow
Populates this object from an xml document containing relevant statistics.

Specified by:
populate in interface CoffeeTableRow
Parameters:
start - the start time, in millis, for this row of data
end - the end time, in millis, for this row of data
data - the statistics and data for this row, as xml
See Also:
CoffeeTableRow.data()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object