Class EqualityEncounterCounter

java.lang.Object
com.mchange.v2.encounter.EqualityEncounterCounter
All Implemented Interfaces:
EncounterCounter

public class EqualityEncounterCounter extends Object
Deprecated.
-- Use of WeakHashMap can't properly guarantee counts with equality semantics, as an Object can be encounted garbage collected, then re-encountered with no apparent history. Clients should explicit choose the semantics they want via WeakEqualityEncounterCounter or StrongEqualityEncounterCounter
  • Constructor Details

    • EqualityEncounterCounter

      public EqualityEncounterCounter()
      Deprecated.
  • Method Details

    • encounter

      public long encounter(Object o)
      Specified by:
      encounter in interface EncounterCounter
      Returns:
      how many times have I seen this object before?
    • reset

      public long reset(Object o)
      Specified by:
      reset in interface EncounterCounter
      Returns:
      how many times have I seen this object before, then remove this Object's history, resetting its count and eliminating any reference from strong counters.
    • resetAll

      public void resetAll()
      Description copied from interface: EncounterCounter
      Remove all Object histories, resetting counts and clearing any references from strong counters.
      Specified by:
      resetAll in interface EncounterCounter