Class Cache<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
de.aristaflow.adept2.util.Cache<K,V>
Type Parameters:
K - The type of the index of the cache.
V - The type of the objects of the cache.
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class Cache<K,V> extends LinkedHashMap<K,V>
Cache implementation. This cache stores a maximum of objects, deleting the least recently used ones.
See Also:
  • Field Details

    • maxSize

      protected final long maxSize
      The maximum size this cache should have
  • Constructor Details

    • Cache

      public Cache(long size)
      Constructor, taking the size of the cache as argument.
      Parameters:
      size -
  • Method Details