Package org.mariadb.jdbc.internal.util
Class ServerPrepareStatementCache
java.lang.Object
java.util.AbstractMap<String,ServerPrepareResult>
java.util.HashMap<String,ServerPrepareResult>
java.util.LinkedHashMap<String,ServerPrepareResult>
org.mariadb.jdbc.internal.util.ServerPrepareStatementCache
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,,ServerPrepareResult> SequencedMap<String,ServerPrepareResult>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerPrepareStatementCachenewInstance(int size, Protocol protocol) put(String key, ServerPrepareResult result) Associates the specified value with the specified key in this map.booleanremoveEldestEntry(Map.Entry eldest) Remove eldestEntry.toString()Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Field Details
-
maxSize
private final int maxSize -
protocol
-
-
Constructor Details
-
ServerPrepareStatementCache
-
-
Method Details
-
newInstance
-
removeEldestEntry
Remove eldestEntry.- Overrides:
removeEldestEntryin classLinkedHashMap<String,ServerPrepareResult> - Parameters:
eldest- eldest entry- Returns:
- true if eldest entry must be removed
-
put
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the existing cached prepared result shared counter will be incremented.- Specified by:
putin interfaceMap<String,ServerPrepareResult> - Overrides:
putin classHashMap<String,ServerPrepareResult> - Parameters:
key- keyresult- new prepare result.- Returns:
- the previous value associated with key if not been deallocate, or null if there was no mapping for key.
-
toString
- Overrides:
toStringin classAbstractMap<String,ServerPrepareResult>
-