com.thinkaurelius.titan.util.stats

## Class ObjectAccumulator<K>

- java.lang.Object
- - com.thinkaurelius.titan.util.stats.ObjectAccumulator<K>

- Type Parameters:
    `K` -

      public class ObjectAccumulator<K>
      extends Object

  This class counts arbitrary objects of type and tries to do so efficiently in time and space. The class offers methods to increase the count of an object by a specified amount or default 1, as well as retrieving the number of times and object has been counted.
  Author:
    Matthias Broecheler

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectAccumulator()`
    `ObjectAccumulator(int initialSize)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getCount(K o)`
    `double` | `getCountSave(K o)`
    `K` | `getMaxObject()`
    `Set<K>` | `getObjects()`
    `boolean` | `hasObject(K obj)`
    `double` | `incBy(K o, double inc)` Increases the count of object o by inc and returns the new count value
    `int` | `numObjects()`
    `boolean` | `removeObject(K obj)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ObjectAccumulator

          public ObjectAccumulator()

    - #### ObjectAccumulator

          public ObjectAccumulator(int initialSize)

  - ### Method Detail

    - #### incBy

          public double incBy(K o,
                     double inc)

      Increases the count of object o by inc and returns the new count value
      Parameters:
        `o` -
        `inc` -
      Returns:

    - #### getCount

          public double getCount(K o)

    - #### getCountSave

          public double getCountSave(K o)

    - #### getObjects

          public Set<K> getObjects()

    - #### numObjects

          public int numObjects()

    - #### hasObject

          public boolean hasObject(K obj)

    - #### removeObject

          public boolean removeObject(K obj)

    - #### getMaxObject

          public K getMaxObject()

Copyright © 2012–2014. All rights reserved.