Class PagedChannelRandomAccessSource.MRU<E>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int limit
      The maximum number of entries held by this MRU
      private java.util.LinkedList<E> queue
      Backing list for managing the MRU
    • Constructor Summary

      Constructors 
      Constructor Description
      MRU​(int limit)
      Constructs an MRU with the specified size
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      E enqueue​(E newElement)
      Adds an element to the MRU.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • limit

        private final int limit
        The maximum number of entries held by this MRU
      • queue

        private java.util.LinkedList<E> queue
        Backing list for managing the MRU
    • Constructor Detail

      • MRU

        public MRU​(int limit)
        Constructs an MRU with the specified size
        Parameters:
        limit - the limit
    • Method Detail

      • enqueue

        public E enqueue​(E newElement)
        Adds an element to the MRU. If the element is already in the MRU, it is moved to the top.
        Parameters:
        newElement - the element to add
        Returns:
        the element that was removed from the MRU to make room for the new element, or null if no element needed to be removed