Class NullCache<T extends Cacheable>
java.lang.Object
org.deltava.util.cache.Cache<T>
org.deltava.util.cache.NullCache<T>
- Type Parameters:
T
- the Cacheable object type
- All Implemented Interfaces:
GeoCache<T>
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(GeoLocation loc, T data) Adds a geographically located object to the cache.protected void
Adds an entry to the cache.void
addNull
(GeoLocation loc) Adds a null entry to the cache.protected void
addNullEntry
(Object key) Adds a null entry to the cache.boolean
contains
(GeoLocation loc) Returns whether the cache contains an entry for a particular location.Retrieves an entry from the cache.get
(GeoLocation loc) Retrieves an object from the cache.getAll
(Collection<?> keys) Returns multiple objects from the cache.final int
Returns the maximum size of the cache.double
Returns the precision of the lat/long key rounding.void
remove
(GeoLocation loc) Removes a location entry from the cache.Methods inherited from class org.deltava.util.cache.Cache
add, addAll, addNull, checkOverflow, clear, contains, getErrors, getHits, getRequests, hit, isRemote, remove, request, setMaxSize, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.deltava.util.cache.GeoCache
createGeoKey
-
Constructor Details
-
NullCache
NullCache()Creates a new null cache.
-
-
Method Details
-
getMaxSize
public final int getMaxSize()Returns the maximum size of the cache.- Overrides:
getMaxSize
in classCache<T extends Cacheable>
- Returns:
- the maximum number of entries in the cache
-
addEntry
Description copied from class:Cache
Adds an entry to the cache. Subclasses need to implement this method to handle cache additions, the public method forces an overflow check. -
addNullEntry
Description copied from class:Cache
Adds a null entry to the cache. Subclasses need to implement this method to handle cache additions, the public method forces an overflow check.- Specified by:
addNullEntry
in classCache<T extends Cacheable>
- Parameters:
key
- the entry key
-
get
-
getRoundingAmount
public double getRoundingAmount()Description copied from interface:GeoCache
Returns the precision of the lat/long key rounding.- Specified by:
getRoundingAmount
in interfaceGeoCache<T extends Cacheable>
- Returns:
- the rounding amount
-
add
-
addNull
-
contains
Description copied from interface:GeoCache
Returns whether the cache contains an entry for a particular location. -
get
-
getAll
-
remove
-