public class WrapperableMappable<K,V> extends Mappable<K,Wrapperable<V>>
| Constructor and Description |
|---|
WrapperableMappable(java.util.Map<K,Wrapperable<V>> map,
boolean isSynchronized) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(K key,
V element) |
void |
addIfAbsent(K key,
Wrapperable<V> val,
V element)
Adds the element to the wrapperable value at the key or adds the input value and then adds the element to it
|
boolean |
addIfUnmatched(K key,
Wrapperable<V> val,
V element)
Returns true if the value was not found and was successfully inserted
|
boolean |
checkAllValues(java.util.function.Function<V,java.lang.Boolean> func)
Uses for loops to return true if the input function evaluates to true
|
void |
forAllValues(java.util.function.Consumer<V> consumer)
forEach can be used if nothing needs to be returned
|
K |
getKeyFromMatchingValue(java.util.function.Function<V,java.lang.Boolean> matcher,
K defVal) |
V |
getMatchingValue(java.util.function.Function<V,java.lang.Boolean> matcher,
V defVal) |
void |
insertFlatValues(java.util.Collection<V> output)
Adds all the values from the wrapperable values of the map to the output collection
|
<C extends java.util.Collection<V>> |
insertFlatValues(java.util.function.Supplier<C> outputSupplier) |
void |
insertMatchingValues(java.util.Collection<V> output,
java.util.function.Function<V,java.lang.Boolean> matcher) |
<C extends java.util.Collection<V>> |
insertMatchingValues(java.util.function.Supplier<C> outputSupplier,
java.util.function.Function<V,java.lang.Boolean> matcher) |
boolean |
matchesAnyValue(V other)
Checks if the input value matches any value under any key
|
boolean |
matchesNone(V other) |
java.util.stream.Stream<V> |
parallelStreamAllValues() |
Wrapperable<V> |
putFast(K key,
java.lang.Iterable<V> itr) |
Wrapperable<V> |
putFast(K key,
java.util.function.Supplier<java.lang.Iterable<V>> wrappableSupplier) |
java.util.stream.Stream<V> |
streamAllValues() |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, forEachKey, forEachValue, get, getKeyOrDefault, isEmpty, isNotEmpty, iterator, keyAbsent, keySet, make, make, makeSynchronized, makeSynchronized, parallelStream, put, putAll, putIfAbsent, remove, size, spliterator, stream, toString, valuespublic WrapperableMappable(java.util.Map<K,Wrapperable<V>> map, boolean isSynchronized)
public void addIfAbsent(@Nullable
K key,
Wrapperable<V> val,
V element)
public boolean addIfUnmatched(@Nullable
K key,
Wrapperable<V> val,
V element)
public boolean checkAllValues(java.util.function.Function<V,java.lang.Boolean> func)
public void forAllValues(java.util.function.Consumer<V> consumer)
public K getKeyFromMatchingValue(java.util.function.Function<V,java.lang.Boolean> matcher, K defVal)
public V getMatchingValue(java.util.function.Function<V,java.lang.Boolean> matcher, V defVal)
public void insertFlatValues(java.util.Collection<V> output)
public <C extends java.util.Collection<V>> C insertFlatValues(java.util.function.Supplier<C> outputSupplier)
public void insertMatchingValues(java.util.Collection<V> output, java.util.function.Function<V,java.lang.Boolean> matcher)
public <C extends java.util.Collection<V>> C insertMatchingValues(java.util.function.Supplier<C> outputSupplier, java.util.function.Function<V,java.lang.Boolean> matcher)
public boolean matchesAnyValue(V other)
public boolean matchesNone(V other)
public Wrapperable<V> putFast(@Nullable K key, java.util.function.Supplier<java.lang.Iterable<V>> wrappableSupplier)
public Wrapperable<V> putFast(@Nullable K key, java.lang.Iterable<V> itr)
public java.util.stream.Stream<V> parallelStreamAllValues()
public java.util.stream.Stream<V> streamAllValues()