com.alibaba.dubbo.common.utils
Class LRUCache<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<K,V>
              extended by com.alibaba.dubbo.common.utils.LRUCache<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class LRUCache<K,V>
extends LinkedHashMap<K,V>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
LRUCache()
           
LRUCache(int maxCapacity)
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 V get(Object key)
           
 int getMaxCapacity()
           
 V put(K key, V value)
           
 V remove(Object key)
           
 void setMaxCapacity(int maxCapacity)
           
 int size()
           
 
Methods inherited from class java.util.LinkedHashMap
containsValue
 
Methods inherited from class java.util.HashMap
clone, entrySet, isEmpty, keySet, putAll, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
entrySet, equals, hashCode, isEmpty, keySet, putAll, values
 

Constructor Detail

LRUCache

public LRUCache()

LRUCache

public LRUCache(int maxCapacity)
Method Detail

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>
Overrides:
containsKey in class HashMap<K,V>

get

public V get(Object key)
Specified by:
get in interface Map<K,V>
Overrides:
get in class LinkedHashMap<K,V>

put

public V put(K key,
             V value)
Specified by:
put in interface Map<K,V>
Overrides:
put in class HashMap<K,V>

remove

public V remove(Object key)
Specified by:
remove in interface Map<K,V>
Overrides:
remove in class HashMap<K,V>

size

public int size()
Specified by:
size in interface Map<K,V>
Overrides:
size in class HashMap<K,V>

clear

public void clear()
Specified by:
clear in interface Map<K,V>
Overrides:
clear in class LinkedHashMap<K,V>

getMaxCapacity

public int getMaxCapacity()

setMaxCapacity

public void setMaxCapacity(int maxCapacity)


Copyright © 2012–2017 Alibaba. All rights reserved.