com.h3c.util.cache

## Class NotedAgeOutHashMap<K,V>

- java.lang.Object
- - com.h3c.util.cache.AgeOutHashMap<K,V>
  - - com.h3c.util.cache.NotedAgeOutHashMap<K,V>

- Type Parameters:
    `K` - the key class
    `V` - the value class
  Direct Known Subclasses:
    VocalAgeOutHashMap

      public class NotedAgeOutHashMap<K,V>
      extends AgeOutHashMap<K,V>

  Extends the functionality of `AgeOutHashMap` to capture the values that are aged-out during interaction with the map, making them available for consumption by an external party.

- - ### Field Summary

    - ### Fields inherited from class com.h3c.util.cache.AgeOutHashMap

      `DEFAULT_AGE_OUT_MS, MIN_AGE_OUT_MS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NotedAgeOutHashMap()` Constructs a map with the initial age-out set to the default number of milliseconds.
    `NotedAgeOutHashMap(long ageOutMs)` Constructs a map with the specified initial age-out value (ms).
    `NotedAgeOutHashMap(long ageOutMs, boolean ageOutDeadwoodOnly)` Constructs a map with the specified initial age-out value (ms) and age-out deadwood only flag.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<V>` | `clearDeadwood()` Returns the set of aged-out values; note that this is a destructive read operation.
    `protected void` | `deadwood(Set<V> values)` Invoked when a set of values are silently removed from the map.
    `protected void` | `deadwood(V value)` Invoked when a value is silently removed from the map.

    - ### Methods inherited from class com.h3c.util.cache.AgeOutHashMap

      `get, getAgeOutMs, prune, put, remove, setAgeOut, size, toString, touch, touchOrPut`

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

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

- - ### Constructor Detail

    - #### NotedAgeOutHashMap

          public NotedAgeOutHashMap()

      Constructs a map with the initial age-out set to the default number of milliseconds.
      See Also:
        `AgeOutHashMap.DEFAULT_AGE_OUT_MS`

    - #### NotedAgeOutHashMap

          public NotedAgeOutHashMap(long ageOutMs)

      Constructs a map with the specified initial age-out value (ms). An exception will be thrown if the given value is below the allowed minimum.
      Parameters:
        `ageOutMs` - the initial age-out value
      Throws:
        `IllegalArgumentException` - if ageOutMs is less than the allowed minimum
      See Also:
        `AgeOutHashMap.MIN_AGE_OUT_MS`

    - #### NotedAgeOutHashMap

          public NotedAgeOutHashMap(long ageOutMs,
                            boolean ageOutDeadwoodOnly)

      Constructs a map with the specified initial age-out value (ms) and age-out deadwood only flag. An exception will be thrown if the given value is below the allowed minimum.
      Parameters:
        `ageOutMs` - the initial age-out value
        `ageOutDeadwoodOnly` - the initial age-out deadwood only value
      Throws:
        `IllegalArgumentException` - if ageOutMs is less than the allowed minimum
      See Also:
        `AgeOutHashMap.MIN_AGE_OUT_MS`

  - ### Method Detail

    - #### deadwood

          protected void deadwood(V value)

      Description copied from class: `AgeOutHashMap`
      Invoked when a value is silently removed from the map. This default implementation does nothing.

      This method is provided so that subclasses may override it and do something interesting with the value just removed.

      Overrides:
        `deadwood` in class `AgeOutHashMap<K,V>`
      Parameters:
        `value` - the value removed from the map

    - #### deadwood

          protected void deadwood(Set<V> values)

      Description copied from class: `AgeOutHashMap`
      Invoked when a set of values are silently removed from the map. This default implementation does nothing.

      This method is provided so that subclasses may override it and do something interesting with the values just removed.

      Overrides:
        `deadwood` in class `AgeOutHashMap<K,V>`
      Parameters:
        `values` - the values removed from the map

    - #### clearDeadwood

          public Set<V> clearDeadwood()

      Returns the set of aged-out values; note that this is a destructive read operation.
      Returns:
        the set of silently aged-out values

Copyright © 2014. All Rights Reserved.