Top Fields Constructors Methods
io.undertow.server.protocol.http

public Class CacheMap<K, V>

extends LinkedHashMap<K, V>
Class Inheritance
Imports
java.util.LinkedHashMap, .Map

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private int
pack-priv static final float
DEFAULT_LOAD_FACTOR

Hides java.util.HashMap.DEFAULT_LOAD_FACTOR.

The load factor used when none specified in constructor.
private static final long

Constructor Summary

AccessConstructor and Description
public
CacheMap(int capacity)

Method Summary

Modifier and TypeMethod and Description
protected boolean
removeEldestEntry(Map.Entry<K, V>
The least recently inserted entry in the map, or if this is an access-ordered map, the least recently accessed entry. This is the entry that will be removed if this method returns true. If the map was empty prior to the put or putAll invocation resulting in this invocation, this will be the entry that was just inserted; in other words, if the map contains a single entry, the eldest entry is also the newest.
eldest
)

Overrides java.util.LinkedHashMap.removeEldestEntry.

removeEldestEntry() should be overridden by the user, otherwise it will not remove the oldest object from the Map.

Inherited from java.util.LinkedHashMap:
clearcontainsValueentrySetforEachgetgetOrDefaultkeySetnewLinkedHashMapputFirstputLastreplaceAllreversedsequencedEntrySetsequencedKeySetsequencedValuesvalues

Field Detail

capacityback to summary
private int capacity
DEFAULT_LOAD_FACTORback to summary
pack-priv static final float DEFAULT_LOAD_FACTOR

Hides java.util.HashMap.DEFAULT_LOAD_FACTOR.

The load factor used when none specified in constructor.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.LinkedHashMap.serialVersionUID.

Constructor Detail

CacheMapback to summary
public CacheMap(int capacity)

Method Detail

removeEldestEntryback to summary
protected boolean removeEldestEntry(Map.Entry<K, V> eldest)

Overrides java.util.LinkedHashMap.removeEldestEntry.

removeEldestEntry() should be overridden by the user, otherwise it will not remove the oldest object from the Map.

Parameters
eldest:Map.Entry<K, V>

Doc from java.util.LinkedHashMap.removeEldestEntry.

The least recently inserted entry in the map, or if this is an access-ordered map, the least recently accessed entry. This is the entry that will be removed if this method returns true. If the map was empty prior to the put or putAll invocation resulting in this invocation, this will be the entry that was just inserted; in other words, if the map contains a single entry, the eldest entry is also the newest.

Returns:boolean

Doc from java.util.LinkedHashMap.removeEldestEntry.

true if the eldest entry should be removed from the map; false if it should be retained.

Annotations
@Override