java.lang.Object
org.postgresql.pljava.internal.CacheMap<T>
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescription<E extends Throwable>
CacheMap.Entry<T> find
(Checked.Consumer<ByteBuffer, E> keyer) Simple lookup, with no way to cache a new entry; returns null if no such entry is present.void
forEachValue
(Consumer<T> action) static <T> CacheMap
<T> newConcurrent
(Supplier<? extends ByteBuffer> keyBufferSupplier) Construct aCacheMap
based on a concurrent map.static <T> CacheMap
<T> newThreadConfined
(Supplier<? extends ByteBuffer> keyBufferSupplier) Construct aCacheMap
based on a non-thread-safe map, for cases where concurrent access from multiple threads can be ruled out.softlyCache
(Checked.Consumer<ByteBuffer, E1> keyer, Checked.Function<ByteBuffer, T, E2> cacher) stronglyCache
(Checked.Consumer<ByteBuffer, E1> keyer, Checked.Function<ByteBuffer, T, E2> cacher) toString()
weaklyCache
(Checked.Consumer<ByteBuffer, E1> keyer, Checked.Function<ByteBuffer, T, E2> cacher)
-
Method Details
-
newConcurrent
Construct aCacheMap
based on a concurrent map. -
newThreadConfined
Construct aCacheMap
based on a non-thread-safe map, for cases where concurrent access from multiple threads can be ruled out. -
softlyCache
public <E extends Throwable,E1 extends E, T softlyCacheE2 extends E> (Checked.Consumer<ByteBuffer, E1> keyer, Checked.Function<ByteBuffer, throws ET, E2> cacher) - Throws:
E
-
weaklyCache
public <E extends Throwable,E1 extends E, T weaklyCacheE2 extends E> (Checked.Consumer<ByteBuffer, E1> keyer, Checked.Function<ByteBuffer, throws ET, E2> cacher) - Throws:
E
-
stronglyCache
public <E extends Throwable,E1 extends E, T stronglyCacheE2 extends E> (Checked.Consumer<ByteBuffer, E1> keyer, Checked.Function<ByteBuffer, throws ET, E2> cacher) - Throws:
E
-
toString
-
find
Simple lookup, with no way to cache a new entry; returns null if no such entry is present.Returns an
Entry
if found, which provides a method to remove the entry if appropriate.- Throws:
E
-
forEachValue
-