harpoon.Util.Collections
Interface InvertibleMultiMap
- All Superinterfaces:
- BinaryRelation, Map, MultiMap
- All Known Implementing Classes:
- GenericInvertibleMultiMap
- public interface InvertibleMultiMap
- extends MultiMap
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.2 2002/02/25 21:09:04 cananian Exp $
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
Methods inherited from interface harpoon.Util.Collections.MultiMap |
add, addAll, addAll, contains, get, getValues, put, putAll, remove, remove, removeAll, retainAll, size |
invert
public InvertibleMultiMap 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.