Class Statistics.Variables

java.lang.Object
marauroa.server.game.Statistics.Variables
All Implemented Interfaces:
Cloneable, Iterable<String>
Enclosing class:
Statistics

public static class Statistics.Variables extends Object implements Iterable<String>, Cloneable
This class is very similar to a Map with the extra that adds some comodity methods like:
  • add
  • print
Author:
miguel
  • Constructor Details

    • Variables

      public Variables()
      Constructor
  • Method Details

    • clear

      public void clear()
      Clear all the variables
    • put

      public void put(String type, long value)
      Put a new variable at the Map
      Parameters:
      type - name of the variable
      value - its value
    • add

      public void add(String type, long value)
      Add value to previously existing variable.
      Parameters:
      type - name of the variable
      value - value to add
    • get

      public long get(String type)
      Returns a variable value
      Parameters:
      type - name of the variable
      Returns:
      its value
    • iterator

      public Iterator<String> iterator()
      Iterate over the variables
      Specified by:
      iterator in interface Iterable<String>
      Returns:
      an iterator over the variables
    • add

      public void add(Statistics.Variables var)
      Adds to this instance the instance var
      Parameters:
      var - a instance of Variables to add to this one.
    • print

      public void print(PrintWriter out, double diff)
      Prints the variable
      Parameters:
      out - the writer to write to
      diff - ignored
    • clone

      public Object clone()
      Overrides:
      clone in class Object