Package com.fasterxml.aalto.util
Class UriCanonicalizer.BoundedHashMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<UriCanonicalizer.CanonicalKey,java.lang.String>
-
- com.fasterxml.aalto.util.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).
-
-
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 casesprivate 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
-
-
-
-
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
-
MAX_SIZE
private static final int MAX_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
removeEldestEntry
public boolean removeEldestEntry(java.util.Map.Entry<UriCanonicalizer.CanonicalKey,java.lang.String> entry)
- Overrides:
removeEldestEntry
in classjava.util.LinkedHashMap<UriCanonicalizer.CanonicalKey,java.lang.String>
-
-