## org.mariadb.jdbc.internal.util
Class ServerPrepareStatementCache

    java.lang.Object
      java.util.AbstractMap<K,V>
          java.util.HashMap<K,V>
              java.util.LinkedHashMap<String,ServerPrepareResult>
                  org.mariadb.jdbc.internal.util.ServerPrepareStatementCache

All Implemented Interfaces:
  Serializable, Cloneable, Map<String,ServerPrepareResult>

    public final class ServerPrepareStatementCache

extends LinkedHashMap<String,ServerPrepareResult>

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class java.util.AbstractMap
`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

Method Summary
`static ServerPrepareStatementCache` `newInstance(int size, Protocol protocol)`
`ServerPrepareResult` `put(String key, ServerPrepareResult result)` Associates the specified value with the specified key in this map.
`boolean` `removeEldestEntry(Map.Entry eldest)` Remove eldestEntry.
`String` `toString()`

Methods inherited from class java.util.LinkedHashMap
`clear, containsValue, get`

Methods inherited from class java.util.HashMap
`clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values`

Methods inherited from class java.util.AbstractMap
`equals, hashCode`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Map
`containsKey, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values`

Method Detail

### newInstance

    public static ServerPrepareStatementCache newInstance(int size,
                                                          Protocol protocol)

### removeEldestEntry

    public boolean removeEldestEntry(Map.Entry eldest)

  Remove eldestEntry.

  Overrides:
    `removeEldestEntry` in class `LinkedHashMap<String,ServerPrepareResult>`
  Parameters:
    `eldest` - eldest entry
  Returns:
    true if eldest entry must be removed

### put

    public ServerPrepareResult put(String key,
                                   ServerPrepareResult result)

  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:
    `put` in interface `Map<String,ServerPrepareResult>`
  Overrides:
    `put` in class `HashMap<String,ServerPrepareResult>`
  Parameters:
    `key` - key
    `result` - new prepare result.
  Returns:
    the previous value associated with key if not been deallocate, or null if there was no mapping for key.

### toString

    public String toString()

  Overrides:
    `toString` in class `AbstractMap<String,ServerPrepareResult>`

Copyright © 2017. All rights reserved.