commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r815023 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractOrderedBidiMapDecorator.java
Date Tue, 15 Sep 2009 05:54:18 GMT
Author: bayard
Date: Tue Sep 15 05:54:18 2009
New Revision: 815023

URL: http://svn.apache.org/viewvc?rev=815023&view=rev
Log:
Merging from -r468106:814127 of collections_jdk5_branch - namely where this code was generified;
mostly in r738956.

Also see the following revisions:

    ------------------------------------------------------------------------
    r471180 | scolebourne | 2006-11-04 05:27:44 -0800 (Sat, 04 Nov 2006) | 1 line
    
    Abstract*Decorator - Generify and use covariant return types
    ------------------------------------------------------------------------

Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractOrderedBidiMapDecorator.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractOrderedBidiMapDecorator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractOrderedBidiMapDecorator.java?rev=815023&r1=815022&r2=815023&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractOrderedBidiMapDecorator.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractOrderedBidiMapDecorator.java
Tue Sep 15 05:54:18 2009
@@ -36,16 +36,17 @@
  *
  * @author Stephen Colebourne
  */
-public abstract class AbstractOrderedBidiMapDecorator
-        extends AbstractBidiMapDecorator implements OrderedBidiMap {
-    
+public abstract class AbstractOrderedBidiMapDecorator<K, V>
+        extends AbstractBidiMapDecorator<K, V>
+        implements OrderedBidiMap<K, V> {
+
     /**
      * Constructor that wraps (not copies).
      *
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if the collection is null
      */
-    protected AbstractOrderedBidiMapDecorator(OrderedBidiMap map) {
+    protected AbstractOrderedBidiMapDecorator(OrderedBidiMap<K, V> map) {
         super(map);
     }
 
@@ -54,33 +55,34 @@
      * 
      * @return the decorated map
      */
-    protected OrderedBidiMap getOrderedBidiMap() {
-        return (OrderedBidiMap) map;
+    protected OrderedBidiMap<K, V> decorated() {
+        return (OrderedBidiMap<K, V>) super.decorated();
     }
 
     //-----------------------------------------------------------------------
-    public OrderedMapIterator orderedMapIterator() {
-        return getOrderedBidiMap().orderedMapIterator();
+    public OrderedMapIterator<K, V> mapIterator() {
+        return decorated().mapIterator();
     }
 
-    public Object firstKey() {
-        return getOrderedBidiMap().firstKey();
+    public K firstKey() {
+        return decorated().firstKey();
     }
 
-    public Object lastKey() {
-        return getOrderedBidiMap().lastKey();
+    public K lastKey() {
+        return decorated().lastKey();
     }
 
-    public Object nextKey(Object key) {
-        return getOrderedBidiMap().nextKey(key);
+    public K nextKey(K key) {
+        return decorated().nextKey(key);
     }
 
-    public Object previousKey(Object key) {
-        return getOrderedBidiMap().previousKey(key);
+    public K previousKey(K key) {
+        return decorated().previousKey(key);
     }
 
-    public OrderedBidiMap inverseOrderedBidiMap() {
-        return getOrderedBidiMap().inverseOrderedBidiMap();
+    @Override
+    public OrderedBidiMap<V, K> inverseBidiMap() {
+        return decorated().inverseBidiMap();
     }
 
 }



Mime
View raw message