You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2009/09/15 07:54:19 UTC

svn commit: r815024 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractSortedBidiMapDecorator.java

Author: bayard
Date: Tue Sep 15 05:54:19 2009
New Revision: 815024

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

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractSortedBidiMapDecorator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractSortedBidiMapDecorator.java?rev=815024&r1=815023&r2=815024&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractSortedBidiMapDecorator.java (original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/AbstractSortedBidiMapDecorator.java Tue Sep 15 05:54:19 2009
@@ -38,16 +38,16 @@
  *
  * @author Stephen Colebourne
  */
-public abstract class AbstractSortedBidiMapDecorator
-        extends AbstractOrderedBidiMapDecorator implements SortedBidiMap {
-    
+public abstract class AbstractSortedBidiMapDecorator<K, V> extends
+        AbstractOrderedBidiMapDecorator<K, V> implements SortedBidiMap<K, V> {
+
     /**
      * Constructor that wraps (not copies).
      *
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if the collection is null
      */
-    public AbstractSortedBidiMapDecorator(SortedBidiMap map) {
+    public AbstractSortedBidiMapDecorator(SortedBidiMap<K, V> map) {
         super(map);
     }
 
@@ -56,29 +56,34 @@
      * 
      * @return the decorated map
      */
-    protected SortedBidiMap getSortedBidiMap() {
-        return (SortedBidiMap) map;
+    protected SortedBidiMap<K, V> decorated() {
+        return (SortedBidiMap<K, V>) super.decorated();
     }
 
     //-----------------------------------------------------------------------
-    public SortedBidiMap inverseSortedBidiMap() {
-        return getSortedBidiMap().inverseSortedBidiMap();
+    @Override
+    public SortedBidiMap<V, K> inverseBidiMap() {
+        return decorated().inverseBidiMap();
+    }
+
+    public Comparator<? super K> comparator() {
+        return decorated().comparator();
     }
 
-    public Comparator comparator() {
-        return getSortedBidiMap().comparator();
+    public Comparator<? super V> valueComparator() {
+        return decorated().valueComparator();
     }
 
-    public SortedMap subMap(Object fromKey, Object toKey) {
-        return getSortedBidiMap().subMap(fromKey, toKey);
+    public SortedMap<K, V> subMap(K fromKey, K toKey) {
+        return decorated().subMap(fromKey, toKey);
     }
 
-    public SortedMap headMap(Object toKey) {
-        return getSortedBidiMap().headMap(toKey);
+    public SortedMap<K, V> headMap(K toKey) {
+        return decorated().headMap(toKey);
     }
 
-    public SortedMap tailMap(Object fromKey) {
-        return getSortedBidiMap().tailMap(fromKey);
+    public SortedMap<K, V> tailMap(K fromKey) {
+        return decorated().tailMap(fromKey);
     }
 
 }