Class ValueWeigher<K>

  • All Implemented Interfaces:
    com.google.common.cache.Weigher<K,​Value>

    public final class ValueWeigher<K>
    extends java.lang.Object
    implements com.google.common.cache.Weigher<K,​Value>

    Implementation of the Guava cache Weigher interface which will calculate the weight for a Value based on how much space is takes in memory.

    Since:
    5.1.1
    Version:
    5.1.1
    Author:
    Evren Sirin
    • Constructor Detail

      • ValueWeigher

        public ValueWeigher​(int keyOverhead)
    • Method Detail

      • weigh

        public int weigh​(K key,
                         Value value)
        Specified by:
        weigh in interface com.google.common.cache.Weigher<K,​Value>
      • weightOf

        public static int weightOf​(Value value)