Package aQute.lib.collections
Class MultiMap<K,V>
java.lang.Object
aQute.lib.collections.MultiMap<K,V>
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Map<? extends K, ? extends Collection<? extends V>> other) boolean
addAll
(K key, Collection<? extends V> value) all()
Return a collection with all valuesvoid
clear()
computeIfPresent
(K key, BiFunction<? super K, ? super List<V>, ? extends List<V>> remappingFunction) boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
flatten()
void
forEach
(BiConsumer<? super K, ? super List<V>> action) static <T extends Comparable<? super T>>
Stringformat
(Map<T, ? extends Collection<?>> map) getOrDefault
(Object key, List<V> defaultValue) int
hashCode()
boolean
isEmpty()
keySet()
merge
(K key, List<V> value, BiFunction<? super List<V>, ? super List<V>, ? extends List<V>> remappingFunction) (package private) static String
pad
(int i) void
putIfAbsent
(K key, List<V> value) boolean
boolean
removeAll
(K key, Collection<? extends V> value) boolean
removeValue
(K key, V value) boolean
void
replaceAll
(BiFunction<? super K, ? super List<V>, ? extends List<V>> function) int
size()
toString()
transpose
(boolean noduplicates) Collection<List<V>>
values()
(package private) static String
vertical
(int padding, Collection<?> used)
-
Field Details
-
noduplicates
private final boolean noduplicates -
keyClass
-
valueClass
-
map
-
-
Constructor Details
-
MultiMap
public MultiMap() -
MultiMap
public MultiMap(boolean noduplicates) -
MultiMap
-
MultiMap
-
MultiMap
-
-
Method Details
-
newValue
-
add
-
addAll
-
addAll
-
removeValue
-
removeAll
-
iterate
-
valuesStream
-
all
-
flatten
-
transpose
-
transpose
-
allValues
Return a collection with all values- Returns:
- all values
-
format
-
vertical
-
pad
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
getOrDefault
- Specified by:
getOrDefault
in interfaceMap<K,
V>
-
forEach
-
replaceAll
- Specified by:
replaceAll
in interfaceMap<K,
V>
-
putIfAbsent
- Specified by:
putIfAbsent
in interfaceMap<K,
V>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsent
in interfaceMap<K,
V>
-
computeIfPresent
public List<V> computeIfPresent(K key, BiFunction<? super K, ? super List<V>, ? extends List<V>> remappingFunction) - Specified by:
computeIfPresent
in interfaceMap<K,
V>
-
compute
-
merge
-
hashCode
public int hashCode() -
equals
-
toString
-