commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r815072 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractOrderedMapDecorator.java
Date Tue, 15 Sep 2009 05:55:55 GMT
Author: bayard
Date: Tue Sep 15 05:55:55 2009
New Revision: 815072

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

    ------------------------------------------------------------------------
    r471189 | scolebourne | 2006-11-04 05:57:57 -0800 (Sat, 04 Nov 2006) | 1 line
    
    Remove getMap(), getOrderedMap() and getSortedMap() - use decorated()
    ------------------------------------------------------------------------
    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/map/AbstractOrderedMapDecorator.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractOrderedMapDecorator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractOrderedMapDecorator.java?rev=815072&r1=815071&r2=815072&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractOrderedMapDecorator.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/AbstractOrderedMapDecorator.java
Tue Sep 15 05:55:55 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.commons.collections.map;
 
-import org.apache.commons.collections.MapIterator;
 import org.apache.commons.collections.OrderedMap;
 import org.apache.commons.collections.OrderedMapIterator;
 
@@ -37,8 +36,8 @@
  *
  * @author Stephen Colebourne
  */
-public abstract class AbstractOrderedMapDecorator
-        extends AbstractMapDecorator implements OrderedMap {
+public abstract class AbstractOrderedMapDecorator<K, V> extends AbstractMapDecorator<K,
V>
+        implements OrderedMap<K, V> {
 
     /**
      * Constructor only used in deserialization, do not use otherwise.
@@ -54,7 +53,7 @@
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if the collection is null
      */
-    public AbstractOrderedMapDecorator(OrderedMap map) {
+    public AbstractOrderedMapDecorator(OrderedMap<K, V> map) {
         super(map);
     }
 
@@ -63,33 +62,29 @@
      * 
      * @return the decorated map
      */
-    protected OrderedMap getOrderedMap() {
-        return (OrderedMap) map;
+    protected OrderedMap<K, V> decorated() {
+        return (OrderedMap<K, V>) super.decorated();
     }
 
     //-----------------------------------------------------------------------
-    public Object firstKey() {
-        return getOrderedMap().firstKey();
+    public K firstKey() {
+        return decorated().firstKey();
     }
 
-    public Object lastKey() {
-        return getOrderedMap().lastKey();
+    public K lastKey() {
+        return decorated().lastKey();
     }
 
-    public Object nextKey(Object key) {
-        return getOrderedMap().nextKey(key);
+    public K nextKey(K key) {
+        return decorated().nextKey(key);
     }
 
-    public Object previousKey(Object key) {
-        return getOrderedMap().previousKey(key);
+    public K previousKey(K key) {
+        return decorated().previousKey(key);
     }
 
-    public MapIterator mapIterator() {
-        return getOrderedMap().mapIterator();
-    }
-
-    public OrderedMapIterator orderedMapIterator() {
-        return getOrderedMap().orderedMapIterator();
+    public OrderedMapIterator<K, V> mapIterator() {
+        return decorated().mapIterator();
     }
 
 }



Mime
View raw message