Class PagedChannelRandomAccessSource.MRU<E>

java.lang.Object
com.itextpdf.io.source.PagedChannelRandomAccessSource.MRU<E>
Enclosing class:
PagedChannelRandomAccessSource

private static class PagedChannelRandomAccessSource.MRU<E> extends Object
  • Field Summary

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

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

    Modifier and Type
    Method
    Description
    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 Details

    • limit

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

      private LinkedList<E> queue
      Backing list for managing the MRU
  • Constructor Details

    • MRU

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

    • 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