net.cscott.jutil
Interface InvertibleMultiMap<K,V>
- All Superinterfaces:
- InvertibleMap<K,V>, Map<K,V>, MultiMap<K,V>
- All Known Implementing Classes:
- GenericInvertibleMultiMap
public interface InvertibleMultiMap<K,V>
- extends MultiMap<K,V>, InvertibleMap<K,V>
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
.
- Version:
- $Id: InvertibleMultiMap.java,v 1.3 2006-10-30 20:14:41 cananian Exp $
- Author:
- C. Scott Ananian
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from interface net.cscott.jutil.MultiMap |
add, addAll, addAll, contains, entrySet, get, getValues, put, putAll, remove, remove, removeAll, retainAll, size |
invert
InvertibleMultiMap<V,K> invert()
- Returns a inverted view of
this
.
Thus, if this
is a MultiMap
with domain A
and range B, the returned MultiMap
,
imap
, will be a MultiMap
with domain
B and range A, such that b in B will map in
imap
to a collection containing a,
if and only if a in this
maps to
a collection containing b.
- Specified by:
invert
in interface InvertibleMap<K,V>
Copyright (c) 2006 C. Scott Ananian