Class FifoPolicy

  • All Implemented Interfaces:
    Policy

    public class FifoPolicy
    extends AbstractPolicy
    Contains common LFU policy code for use between the LfuMemoryStore and the DiskStore, which also uses an LfuPolicy for evictions.
    Version:
    $Id$
    Author:
    Greg Luck
    • Field Detail

      • NAME

        public static final java.lang.String NAME
        The name of this policy as a string literal
        See Also:
        Constant Field Values
    • Constructor Detail

      • FifoPolicy

        public FifoPolicy()
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns:
        the name of the Policy. Inbuilt examples are LRU, LFU and FIFO.
      • compare

        public boolean compare​(Element element1,
                               Element element2)
        Compares the desirableness for eviction of two elements Compares hit counts. If both zero,
        Parameters:
        element1 - the element to compare against
        element2 - the element to compare
        Returns:
        true if the second element is preferable to the first element for ths policy