com.h3c.sdn.misc.net

## Class ConcurrentAgingLRUHashMap<K,V>

- java.lang.Object
- - com.h3c.sdn.misc.net.ConcurrentAgingLRUHashMap<K,V>

- Type Parameters:
    `K` - Key
    `V` - Value

      public class ConcurrentAgingLRUHashMap<K,V>
      extends Object

  ConcurrentAgingLRUHashMap is a wrapper around concurrent HashMap which provides per record aging feature and limits the size of the table.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `CopyOnWriteArrayList<NMAlgoListener>` | `algoListenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConcurrentAgingLRUHashMap(long size)` Constructs a ConcurrentAgingLRUHashMap structure.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear all entries in the map.
    `Set<Map.Entry<K,V>>` | `entrySet()` Return a set with key value pair.
    `V` | `get(K key)` Returns the value for given key.
    `void` | `othersClear()`
    `void` | `put(K key, V value)` Stores the key value pair into the Map.
    `void` | `remove(K key)` Remove the value for given key.
    `void` | `removeOthers(K key)` Remove the value for given key.
    `void` | `replace(K key, V value)` Replace the entry for the given Key Value pair.
    `int` | `size()` Returns the number of entries.
    `Collection<V>` | `values()` Return a collection with only values

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

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

- - ### Field Detail

    - #### algoListenerList

          public CopyOnWriteArrayList<NMAlgoListener> algoListenerList

  - ### Constructor Detail

    - #### ConcurrentAgingLRUHashMap

          public ConcurrentAgingLRUHashMap(long size)

      Constructs a ConcurrentAgingLRUHashMap structure.
      Parameters:
        `size` - max size allowed for the map

  - ### Method Detail

    - #### size

          public int size()

      Returns the number of entries.
      Returns:
        size of the map

    - #### get

          public V get(K key)

      Returns the value for given key.
      Parameters:
        `key` - for which value needs to retrieved
      Returns:
        value corresponding to the key

    - #### put

          public void put(K key,
                 V value)

      Stores the key value pair into the Map.
      Parameters:
        `key` - Key
        `value` - Value

    - #### remove

          public void remove(K key)

      Remove the value for given key.
      Parameters:
        `key` - remove value corresponding to key

    - #### removeOthers

          public void removeOthers(K key)

      Remove the value for given key.
      Parameters:
        `key` - remove value corresponding to key

    - #### replace

          public void replace(K key,
                     V value)

      Replace the entry for the given Key Value pair.
      Parameters:
        `key` - Key
        `value` - Value

    - #### entrySet

          public Set<Map.Entry<K,V>> entrySet()

      Return a set with key value pair.
      Returns:
        Set Set with key value pair

    - #### values

          public Collection<V> values()

      Return a collection with only values
      Returns:
        values collection of values

    - #### clear

          public void clear()

      Clear all entries in the map.

    - #### othersClear

          public void othersClear()

Copyright © 2014. All Rights Reserved.