ExpiringMap (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.utils

## Class ExpiringMap<K,V>

- java.lang.Object
- - org.apache.cassandra.utils.ExpiringMap<K,V>

-     public class ExpiringMap<K,V>
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ExpiringMap.CacheableObject<T>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExpiringMap(long defaultExpiration)`
    `ExpiringMap(long defaultExpiration, com.google.common.base.Function<Pair<K,ExpiringMap.CacheableObject<V>>,?> postExpireHook)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsKey(K key)`
    `V` | `get(K key)`
    `long` | `getAge(K key)`
    `boolean` | `isEmpty()`
    `java.util.Set<K>` | `keySet()`
    `V` | `put(K key, V value)`
    `V` | `put(K key, V value, long timeout)`
    `V` | `remove(K key)`
    `void` | `reset()`
    `void` | `shutdownBlocking()`
    `int` | `size()`

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

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

- - ### Constructor Detail

    - #### ExpiringMap

          public ExpiringMap(long defaultExpiration)

    - #### ExpiringMap

          public ExpiringMap(long defaultExpiration,
                     com.google.common.base.Function<Pair<K,ExpiringMap.CacheableObject<V>>,?> postExpireHook)

      Parameters:
        `defaultExpiration` - the TTL for objects in the cache in milliseconds

  - ### Method Detail

    - #### shutdownBlocking

          public void shutdownBlocking()

    - #### reset

          public void reset()

    - #### put

          public V put(K key,
              V value)

    - #### put

          public V put(K key,
              V value,
              long timeout)

    - #### get

          public V get(K key)

    - #### remove

          public V remove(K key)

    - #### getAge

          public long getAge(K key)

      Returns:
        System.nanoTime() when key was put into the map.

    - #### size

          public int size()

    - #### containsKey

          public boolean containsKey(K key)

    - #### isEmpty

          public boolean isEmpty()

    - #### keySet

          public java.util.Set<K> keySet()

Copyright © 2014 The Apache Software Foundation