Package net.cscott.jutil
Interface InvertibleMultiMap<K,V>
- All Superinterfaces:
InvertibleMap<K,,V> Map<K,,V> MultiMap<K,V>
- All Known Implementing Classes:
GenericInvertibleMultiMap
An
InvertibleMultiMap is an extension of the
MultiMap interface to allow users to do reverse lookups on
the mappings maintained.
If, for MultiMap m,
m.contains(a, b), then
m.invert().contains(b, a).
If the InvertibleMultiMap is mutable, the
InvertibleMultiMap returned by its invert()
method should also be mutable. Moreover, for any
InvertibleMultiMap,
this.invert().invert()==this.- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
-
Nested Class Summary
-
Method Summary
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, replace, values
-
Method Details
-
invert
InvertibleMultiMap<V,K> invert()Returns a inverted view ofthis. Thus, ifthisis aMultiMapwith domain A and range B, the returnedMultiMap,imap, will be aMultiMapwith domain B and range A, such that b in B will map inimapto a collection containing a, if and only if a inthismaps to a collection containing b.- Specified by:
invertin interfaceInvertibleMap<K,V>
-