com.h3c.util.cache

## Class VocalAgeOutHashMap<K,V>

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

- Type Parameters:
    `K` - the key class
    `V` - the value class

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

  Extends the functionality of `NotedAgeOutHashMap` to allow listeners to register for value removal events.

- - ### 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
    `VocalAgeOutHashMap()` Constructs a map with the initial age-out set to the default number of milliseconds.
    `VocalAgeOutHashMap(long ageOutMs)` Constructs a map with the specified initial age-out value (ms).

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()` Activates the vocal map, scheduling the map pruner to run at the configured interval.
    `void` | `addListener(VocalMapListener<V> listener)` Adds the specified listener to this map.
    `void` | `deactivate()` Deactivates the vocal map, stopping the map pruner from running.
    `void` | `removeListener(VocalMapListener<V> listener)` Removes the specified listener from this map.

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

      `clearDeadwood, deadwood, deadwood`

    - ### 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

    - #### VocalAgeOutHashMap

          public VocalAgeOutHashMap()

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

    - #### VocalAgeOutHashMap

          public VocalAgeOutHashMap(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`

  - ### Method Detail

    - #### activate

          public void activate()

      Activates the vocal map, scheduling the map pruner to run at the configured interval.

    - #### deactivate

          public void deactivate()

      Deactivates the vocal map, stopping the map pruner from running.

    - #### addListener

          public void addListener(VocalMapListener<V> listener)

      Adds the specified listener to this map.
      Parameters:
        `listener` - the listener to be added

    - #### removeListener

          public void removeListener(VocalMapListener<V> listener)

      Removes the specified listener from this map.
      Parameters:
        `listener` - the listener to be removed

Copyright © 2014. All Rights Reserved.