Class AgingCache<T extends Cacheable>

java.lang.Object
org.deltava.util.cache.Cache<T>
org.deltava.util.cache.AgingCache<T>
Type Parameters:
T - the Cacheable object type

public class AgingCache<T extends Cacheable> extends Cache<T>
An object cache that supports creation dates. The major difference between this cache and a ExpiringCache is that this cache does not purge an entry until the cache overflows, whereas an ExpiringCache invalidates data based on age.
Since:
1.0
Version:
7.2
Author:
Luke
  • Field Details

    • _lastCreationTime

      protected long _lastCreationTime
  • Constructor Details

  • Method Details

    • addEntry

      protected void addEntry(T obj)
      Adds an entry to the cache.
      Specified by:
      addEntry in class Cache<T extends Cacheable>
      Parameters:
      obj - the entry to add to the cache
    • addNullEntry

      protected void addNullEntry(Object key)
      Adds a null entry to the cache.
      Specified by:
      addNullEntry in class Cache<T extends Cacheable>
      Parameters:
      key - the entry key
    • get

      public T get(Object key)
      Returns an entry from the cache.
      Specified by:
      get in class Cache<T extends Cacheable>
      Parameters:
      key - the cache key
      Returns:
      the cache entry, or null if not present