Class FIFOObjectCache<T>

  • All Implemented Interfaces:
    ObjectCache<T>

    public class FIFOObjectCache<T>
    extends java.lang.Object
    implements ObjectCache<T>
    A FIFO ObjectCache implementation.
    • Constructor Detail

      • FIFOObjectCache

        public FIFOObjectCache()
      • FIFOObjectCache

        public FIFOObjectCache​(int size)
    • Method Detail

      • addObject

        public void addObject​(ObjectKey<T> objectKey,
                              T object)
        Description copied from interface: ObjectCache
        Adds an object under the given key to the cache.
        Specified by:
        addObject in interface ObjectCache<T>
        Parameters:
        objectKey - the ObjectKey
        object - the object to be added
      • clear

        public void clear()
        Description copied from interface: ObjectCache
        Clear the cache.
        Specified by:
        clear in interface ObjectCache<T>
      • getObject

        public T getObject​(ObjectKey<T> objectKey)
        Description copied from interface: ObjectCache
        Get the object which is found under the given key. Returns null when no object is found.
        Specified by:
        getObject in interface ObjectCache<T>
        Returns:
        Object or null if there was no object with the given key in the cache.
      • removeObject

        public T removeObject​(ObjectKey<T> objectKey)
        Description copied from interface: ObjectCache
        Removes an object from the cache.
        Specified by:
        removeObject in interface ObjectCache<T>
        Parameters:
        objectKey - ObjectKey
        Returns:
        the bean if it was mapped before or null