Package com.fasterxml.aalto.util
Class UriCanonicalizer.BoundedHashMap
java.lang.Object
java.util.AbstractMap<UriCanonicalizer.CanonicalKey,String>
java.util.HashMap<UriCanonicalizer.CanonicalKey,String>
java.util.LinkedHashMap<UriCanonicalizer.CanonicalKey,String>
com.fasterxml.aalto.util.UriCanonicalizer.BoundedHashMap
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<UriCanonicalizer.CanonicalKey,
,String> SequencedMap<UriCanonicalizer.CanonicalKey,
String>
- Enclosing class:
UriCanonicalizer
static final class UriCanonicalizer.BoundedHashMap
extends LinkedHashMap<UriCanonicalizer.CanonicalKey,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
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
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 final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, 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
Methods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
DEFAULT_SIZE
private static final int DEFAULT_SIZELet'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:
-
MAX_SIZE
private static final int MAX_SIZE- See Also:
-
-
Constructor Details
-
BoundedHashMap
public BoundedHashMap()
-
-
Method Details
-
removeEldestEntry
- Overrides:
removeEldestEntry
in classLinkedHashMap<UriCanonicalizer.CanonicalKey,
String>
-