de.esprit.common.util

## Class AccessCounter

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.common.util.AccessCounter

- All Implemented Interfaces:
    Dumpable, java.io.Serializable

      public class AccessCounter
      extends DumpableObject
      implements java.io.Serializable

  This class is supposed to create statistics for object accesses. It counts how often the access() method was called on the same object and reports a sorted summary.
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccessCounter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `access(int key)`
    `int` | `access(java.lang.Object o)`
    `void` | `clear()`
    `int` | `getAccessedKeysCount()`
    `int` | `getCountFor(int key)`
    `int` | `getCountFor(java.lang.Object obj)`
    `int` | `size()`
    `DumpString` | `toDumpString(DumpString s)` This method allows subclasses to add values to the existing DumpString of the superclass.
    `ToString` | `toString(ToString s)` This method allows subclasses to add values to the existing ToString of the superclass.
    `boolean` | `wasAccessed(java.lang.Object obj)`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

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

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

- - ### Constructor Detail

    - #### AccessCounter

          public AccessCounter()

  - ### Method Detail

    - #### access

          public int access(int key)

    - #### access

          public int access(java.lang.Object o)

    - #### clear

          public void clear()

    - #### size

          public int size()

    - #### getCountFor

          public int getCountFor(int key)

    - #### getCountFor

          public int getCountFor(java.lang.Object obj)

    - #### getAccessedKeysCount

          public int getAccessedKeysCount()

    - #### wasAccessed

          public boolean wasAccessed(java.lang.Object obj)

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.