KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > collections > OrderedBidiMap


1 /*
2  * Copyright 2003-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.collections;
17
18 /**
19  * Defines a map that allows bidirectional lookup between key and values
20  * and retains and provides access to an ordering.
21  * <p>
22  * Implementations should allow a value to be looked up from a key and
23  * a key to be looked up from a value with equal performance.
24  *
25  * @since Commons Collections 3.0
26  * @version $Revision: 1.4 $ $Date: 2004/02/18 01:15:42 $
27  *
28  * @author Stephen Colebourne
29  */

30 public interface OrderedBidiMap extends BidiMap, OrderedMap {
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.
36      * This enables both directions of the map to be accessed equally.
37      * <p>
38      * Implementations should seek to avoid creating a new object every time this
39      * method is called. See <code>AbstractMap.values()</code> etc. Calling this
40      * 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 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.
53      * This enables both directions of the map to be accessed equally.
54      * <p>
55      * Implementations should seek to avoid creating a new object every time this
56      * method is called. See <code>AbstractMap.values()</code> etc. Calling this
57      * method on the inverse map should return the original.
58      *
59      * @return an inverted bidirectional map
60      */

61     public OrderedBidiMap inverseOrderedBidiMap();
62     
63 }
64
Popular Tags