Package org.comroid.uniform.cache
Class BasicCache<K,V>
- java.lang.Object
-
- org.comroid.uniform.cache.BasicCache<K,V>
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<K,V>>,org.comroid.mutatio.ref.ReferenceMap<K,V,Cache.Reference<K,V>>,org.comroid.mutatio.ref.ReferenceMap.Settable<K,V,Cache.Reference<K,V>>,Cache<K,V>
- Direct Known Subclasses:
ProvidedCache
public class BasicCache<K,V> extends java.lang.Object implements Cache<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.comroid.uniform.cache.Cache
Cache.Reference<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LARGE_THRESHOLD
-
Constructor Summary
Constructors Modifier Constructor Description BasicCache()BasicCache(int largeThreshold)protectedBasicCache(int largeThreshold, java.util.Map<K,Cache.Reference<K,V>> map)protectedBasicCache(int largeThreshold, java.util.Map<K,Cache.Reference<K,V>> map, org.comroid.api.Provider.Now<V> emptyValueProvider)protectedBasicCache(java.util.Map<K,Cache.Reference<K,V>> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(K key)booleancontainsValue(V value)@NotNull Cache.Reference<K,V>getReference(K key, boolean createIfAbsent)@NotNull java.util.Iterator<java.util.Map.Entry<K,V>>iterator()booleanlarge()org.comroid.mutatio.pipe.Pipe<?,Cache.Reference<K,V>>pipe(java.util.function.Predicate<K> filter)intsize()java.util.stream.Stream<Cache.Reference<K,V>>stream(java.util.function.Predicate<K> filter)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.comroid.uniform.cache.Cache
canProvide, forEach, pipe, provide, stream
-
-
-
-
Field Detail
-
DEFAULT_LARGE_THRESHOLD
public static final int DEFAULT_LARGE_THRESHOLD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BasicCache
public BasicCache()
-
BasicCache
public BasicCache(int largeThreshold)
-
BasicCache
protected BasicCache(java.util.Map<K,Cache.Reference<K,V>> map)
-
BasicCache
protected BasicCache(int largeThreshold, java.util.Map<K,Cache.Reference<K,V>> map)
-
BasicCache
protected BasicCache(int largeThreshold, java.util.Map<K,Cache.Reference<K,V>> map, @Nullable org.comroid.api.Provider.Now<V> emptyValueProvider)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
iterator
@NotNull public @NotNull java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<K>
-
containsKey
public boolean containsKey(K key)
- Specified by:
containsKeyin interfaceCache<K,V>
-
containsValue
public boolean containsValue(V value)
- Specified by:
containsValuein interfaceCache<K,V>
-
stream
public final java.util.stream.Stream<Cache.Reference<K,V>> stream(java.util.function.Predicate<K> filter)
-
pipe
public org.comroid.mutatio.pipe.Pipe<?,Cache.Reference<K,V>> pipe(java.util.function.Predicate<K> filter)
-
getReference
@NotNull public @NotNull Cache.Reference<K,V> getReference(K key, boolean createIfAbsent)
- Specified by:
getReferencein interfaceCache<K,V>- Specified by:
getReferencein interfaceorg.comroid.mutatio.ref.ReferenceMap<K,V,Cache.Reference<K,V>>
-
-