Class UriCanonicalizer.BoundedHashMap

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<UriCanonicalizer.CanonicalKey,​java.lang.String>
    Enclosing class:
    UriCanonicalizer

    static final class UriCanonicalizer.BoundedHashMap
    extends java.util.LinkedHashMap<UriCanonicalizer.CanonicalKey,​java.lang.String>
    We'll use a bounded map, which should work well for most normal cases, but avoid excesses for degenerate cases (unique URIs used as idenfitiers etc).
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int DEFAULT_SIZE
      Let's create cache big enough to usually have enough space for all/most entries for normal cases, but that won't grow indefinitely for degenerate cases
      private static int MAX_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundedHashMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean removeEldestEntry​(java.util.Map.Entry<UriCanonicalizer.CanonicalKey,​java.lang.String> entry)  
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
      • Methods inherited from class java.util.HashMap

        clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
    • Field Detail

      • DEFAULT_SIZE

        private static final int DEFAULT_SIZE
        Let's create cache big enough to usually have enough space for all/most entries for normal cases, but that won't grow indefinitely for degenerate cases
        See Also:
        Constant Field Values
    • Constructor Detail

      • BoundedHashMap

        public BoundedHashMap()