Class TallyTable

java.lang.Object
org.cdlib.mrt.utility.TallyTable

public class TallyTable extends Object
Generalized counting queue Copied - DLoy
  • Field Details

  • Constructor Details

    • TallyTable

      public TallyTable()
  • Method Details

    • bump

      public void bump(TallyTable inCount)
      increment counts using another CountQueue
      Parameters:
      inCount - CountQueue to be added
    • bump

      public void bump(String name)
      increment a counter with this name by 1 and save
      Parameters:
      name - of the counter to be incremented
    • bump

      public void bump(String name, long amount)
      increment a counter with this name and save
      Parameters:
      name - of the counter to be incremented
      amount - to bump counter
    • set

      public void set(String name, long amount)
      set tally value
      Parameters:
      name - of the counter to be incremented
      amount - to bump counter
    • clear

      public void clear()
    • addDiffTime

      public long addDiffTime(String key, long from)
      Add difference in time from arg to now
      Parameters:
      key - - name of key to be incremented
      from - start time value
      Returns:
      current time
    • divide

      public Double divide(String numerator, String divisor)
    • getValue

      public Long getValue(String key)
    • getTime

      public long getTime()
      Add difference in time from arg to now
      Parameters:
      key - - name of key to be incremented
      from - start time value
      Returns:
      current time
    • dump

      public String dump()
      increment a counter with this name and save
      Parameters:
      name - of the counter to be incremented
      amount - to bump counter
    • dumpProp

      public String dumpProp()
      increment a counter with this name and save
      Parameters:
      name - of the counter to be incremented
      amount - to bump counter
    • getCountKeys

      public String[] getCountKeys()
      Build sorted array of tally keys
      Returns:
    • getCount

      public long getCount(String key)
      Get the count for this key
      Parameters:
      key - key used for extracting tally count
      Returns:
      tally count
    • size

      public int size()
      number of tally items
      Returns:
      number of tally items
    • loadTable

      public void loadTable(File loadFile) throws TException
      Load tally count from file
      Parameters:
      loadFile - file to be loaded for tally
      Throws:
      TException
    • getAsProperties

      public Properties getAsProperties()
    • saveTable

      public void saveTable(File loadFile) throws TException
      Throws:
      TException
    • getTallyMap

      public Map getTallyMap()