1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.collections15;
17
18 /***
19 * Defines a map that allows bidirectional lookup between key and values and
20 * retains and provides access to an ordering.
21 * <p/>
22 * Implementations should allow a value to be looked up from a key and a key to
23 * be looked up from a value with equal performance.
24 *
25 * @author Stephen Colebourne
26 * @version $Revision: 1.2 $ $Date: 2004/10/17 01:02:42 $
27 * @since Commons Collections 3.0
28 */
29 public interface OrderedBidiMap <K, V> extends BidiMap<K, V>, OrderedMap<K, V>
30 {
31
32 /***
33 * Gets a view of this map where the keys and values are reversed.
34 * <p/>
35 * Changes to one map will be visible in the other and vice versa. This
36 * enables both directions of the map to be accessed equally.
37 * <p/>
38 * Implementations should seek to avoid creating a new object every time
39 * this method is called. See <code>AbstractMap.values()</code> etc. Calling
40 * this method on the inverse map should return the original.
41 * <p/>
42 * Implementations must return an <code>OrderedBidiMap</code> instance,
43 * usually by forwarding to <code>inverseOrderedBidiMap()</code>.
44 *
45 * @return an inverted bidirectional map
46 */
47 public BidiMap<V, K> inverseBidiMap();
48
49 /***
50 * Gets a view of this map where the keys and values are reversed.
51 * <p/>
52 * Changes to one map will be visible in the other and vice versa. This
53 * enables both directions of the map to be accessed equally.
54 * <p/>
55 * Implementations should seek to avoid creating a new object every time
56 * this method is called. See <code>AbstractMap.values()</code> etc. Calling
57 * this method on the inverse map should return the original.
58 *
59 * @return an inverted bidirectional map
60 */
61 public OrderedBidiMap<V, K> inverseOrderedBidiMap();
62
63 }