net.cscott.jutil

Interface InvertibleMap<K,V>

public interface InvertibleMap<K,V> extends Map<K,V>

An InvertibleMap is an extension of the Map interface to allow users to do reverse lookups on the mappings maintained. Since Maps are allowed to map multiple keys to a single value, the inversion of a Map is not necessarily a Map itself; thus we return a MultiMap for the inverted view. The returned MultiMap is not guaranteed to be modfiable, even if this is (ie, changes to the data structure may still have to be made through this rather than directly to the returned MultiMap).

Version: $Id: InvertibleMap.java,v 1.1 2003/03/20 01:58:20 cananian Exp $

Author: Felix S. Klock II

Method Summary
MultiMap<V,K>invert()
Returns a inverted view of this.

Method Detail

invert

public MultiMap<V,K> invert()
Returns a inverted view of this. Thus, if this is a Map with domain A and range B, the returned MultiMap, imap, will be a MultiMap with domain B and range A, such that each b in B will map in imap to Collection of A, c, if and only if each a in c maps to b in this.
Copyright © 2003 C. Scott Ananian