org.thymeleaf.util
Class CacheMap<K,V>

Object
  extended by org.thymeleaf.util.CacheMap<K,V>
Type Parameters:
K - The type of the cache map keys
V - The type of the cache map values
All Implemented Interfaces:
Serializable

public final class CacheMap<K,V>
extends Object
implements Serializable

Generic cache map implementation.

Features:

Since:
1.1.3
Author:
Daniel Fernández, Guven Demir
See Also:
Serialized Form

Nested Class Summary
static interface CacheMap.ICacheMapEntryValidityChecker<K,V>
           Defines the logic needed to (optionally) validate an entry living in a CacheMap before returning it as the result of a get operation.
 
Field Summary
static String CACHE_LOGGER_NAME
           
protected static org.slf4j.Logger logger
           
 
Constructor Summary
CacheMap(String name, boolean useSoftReferences, int initialCapacity)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, float loadFactor)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, float loadFactor, CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, float loadFactor, int maxSize)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, float loadFactor, int maxSize, CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, int maxSize)
           
CacheMap(String name, boolean useSoftReferences, int initialCapacity, int maxSize, CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)
           
 
Method Summary
 void clear()
           
 void clearKey(K key)
           
 V get(K key)
           
 V get(K key, CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> validityChecker)
           
 int getMaxSize()
           
 String getName()
           
 boolean getUseSoftReferences()
           
 boolean hasMaxSize()
           
 V put(K key, V value)
           
 int size()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_LOGGER_NAME

public static final String CACHE_LOGGER_NAME

logger

protected static final org.slf4j.Logger logger
Constructor Detail

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                int maxSize)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                int maxSize,
                CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                float loadFactor)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                float loadFactor,
                CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                float loadFactor,
                int maxSize)

CacheMap

public CacheMap(String name,
                boolean useSoftReferences,
                int initialCapacity,
                float loadFactor,
                int maxSize,
                CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> entryValidityChecker)
Method Detail

put

public V put(K key,
             V value)

get

public V get(K key)

get

public V get(K key,
             CacheMap.ICacheMapEntryValidityChecker<? super K,? super V> validityChecker)

clear

public void clear()

clearKey

public void clearKey(K key)

getName

public String getName()

hasMaxSize

public boolean hasMaxSize()

getMaxSize

public int getMaxSize()

getUseSoftReferences

public boolean getUseSoftReferences()

size

public int size()


Copyright © 2012 The THYMELEAF team. All Rights Reserved.