commons-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=815021&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/AbstractBidiMapDecorator.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractBidiMapDecorator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractBidiMapDecorator.java?rev=815021&r1=815020&r2=815021&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractBidiMapDecorator.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractBidiMapDecorator.java
Tue Sep 15 05:54:14 2009
@@ -37,16 +37,16 @@
  *
  * @author Stephen Colebourne
  */
-public abstract class AbstractBidiMapDecorator
-        extends AbstractMapDecorator implements BidiMap {
-    
+public abstract class AbstractBidiMapDecorator<K, V> extends AbstractMapDecorator<K,
V> implements
+        BidiMap<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 AbstractBidiMapDecorator(BidiMap map) {
+    protected AbstractBidiMapDecorator(BidiMap<K, V> map) {
         super(map);
     }
 
@@ -55,25 +55,25 @@
      * 
      * @return the decorated map
      */
-    protected BidiMap getBidiMap() {
-        return (BidiMap) map;
+    protected BidiMap<K, V> decorated() {
+        return (BidiMap<K, V>) super.decorated();
     }
 
     //-----------------------------------------------------------------------
-    public MapIterator mapIterator() {
-        return getBidiMap().mapIterator();
+    public MapIterator<K, V> mapIterator() {
+        return decorated().mapIterator();
     }
 
-    public Object getKey(Object value) {
-        return getBidiMap().getKey(value);
+    public K getKey(Object value) {
+        return decorated().getKey(value);
     }
 
-    public Object removeValue(Object value) {
-        return getBidiMap().removeValue(value);
+    public K removeValue(Object value) {
+        return decorated().removeValue(value);
     }
 
-    public BidiMap inverseBidiMap() {
-        return getBidiMap().inverseBidiMap();
+    public BidiMap<V, K> inverseBidiMap() {
+        return decorated().inverseBidiMap();
     }
 
 }



Mime
View raw message