You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/12/06 14:03:15 UTC

cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/keyvalue AbstractMapEntryDecorator.java

scolebourne    2003/12/06 05:03:15

  Modified:    collections/src/java/org/apache/commons/collections/bidimap
                        TreeBidiMap.java
               collections/src/java/org/apache/commons/collections
                        SequencedHashMap.java DefaultMapEntry.java
                        StaticBucketMap.java ReferenceMap.java
                        DoubleOrderedMap.java
               collections/src/java/org/apache/commons/collections/map
                        HashedMap.java StaticBucketMap.java
                        ReferenceMap.java
               collections/src/java/org/apache/commons/collections/keyvalue
                        AbstractMapEntryDecorator.java
  Log:
  Ensure all MapEntry implementation are also KeyValue implementations
  
  Revision  Changes    Path
  1.6       +4 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
  
  Index: TreeBidiMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TreeBidiMap.java	5 Dec 2003 20:23:58 -0000	1.5
  +++ TreeBidiMap.java	6 Dec 2003 13:03:15 -0000	1.6
  @@ -67,6 +67,7 @@
   
   import org.apache.commons.collections.BidiMap;
   import org.apache.commons.collections.IteratorUtils;
  +import org.apache.commons.collections.KeyValue;
   import org.apache.commons.collections.MapIterator;
   import org.apache.commons.collections.OrderedBidiMap;
   import org.apache.commons.collections.OrderedIterator;
  @@ -1713,7 +1714,7 @@
       /**
        * A node used to store the data.
        */
  -    static class Node implements Map.Entry {
  +    static class Node implements Map.Entry, KeyValue {
   
           private Comparable[] data;
           private Node[] leftNode;
  
  
  
  1.23      +3 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/SequencedHashMap.java
  
  Index: SequencedHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/SequencedHashMap.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SequencedHashMap.java	3 Dec 2003 11:37:44 -0000	1.22
  +++ SequencedHashMap.java	6 Dec 2003 13:03:15 -0000	1.23
  @@ -104,7 +104,7 @@
        * {@link java.util.Map.Entry} that doubles as a node in the linked list
        * of sequenced mappings.  
        */
  -    private static class Entry implements Map.Entry {
  +    private static class Entry implements Map.Entry, KeyValue {
           // Note: This class cannot easily be made clonable.  While the actual
           // implementation of a clone would be simple, defining the semantics is
           // difficult.  If a shallow clone is implemented, then entry.next.prev !=
  
  
  
  1.16      +4 -5      jakarta-commons/collections/src/java/org/apache/commons/collections/DefaultMapEntry.java
  
  Index: DefaultMapEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/DefaultMapEntry.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DefaultMapEntry.java	5 Dec 2003 20:23:57 -0000	1.15
  +++ DefaultMapEntry.java	6 Dec 2003 13:03:15 -0000	1.16
  @@ -62,6 +62,7 @@
   /**
    * A default implementation of {@link java.util.Map.Entry}
    *
  + * @deprecated Use the version in the keyvalue subpackage.
    * @since Commons Collections 1.0
    * @version $Revision$ $Date$
    * 
  @@ -69,10 +70,8 @@
    * @author Michael A. Smith
    * @author Neil O'Toole
    * @author Stephen Colebourne
  - * 
  - * @deprecated Use the version in the keyvalue subpackage.
    */
  -public class DefaultMapEntry implements Map.Entry {
  +public class DefaultMapEntry implements Map.Entry, KeyValue {
       
       /** The key */
       private Object key;
  
  
  
  1.14      +3 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java
  
  Index: StaticBucketMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- StaticBucketMap.java	3 Dec 2003 15:16:49 -0000	1.13
  +++ StaticBucketMap.java	6 Dec 2003 13:03:15 -0000	1.14
  @@ -491,7 +491,7 @@
       /**
        * The Map.Entry for the StaticBucketMap.
        */
  -    private static final class Node implements Map.Entry
  +    private static final class Node implements Map.Entry, KeyValue
       {
           protected Object key;
           protected Object value;
  
  
  
  1.19      +3 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/ReferenceMap.java
  
  Index: ReferenceMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/ReferenceMap.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ReferenceMap.java	5 Dec 2003 20:23:57 -0000	1.18
  +++ ReferenceMap.java	6 Dec 2003 13:03:15 -0000	1.19
  @@ -758,7 +758,7 @@
   
       // If getKey() or getValue() returns null, it means
       // the mapping is stale and should be removed.
  -    private class Entry implements Map.Entry {
  +    private class Entry implements Map.Entry, KeyValue {
   
           Object key;
           Object value;
  
  
  
  1.9       +3 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/DoubleOrderedMap.java
  
  Index: DoubleOrderedMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/DoubleOrderedMap.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DoubleOrderedMap.java	29 Nov 2003 18:05:39 -0000	1.8
  +++ DoubleOrderedMap.java	6 Dec 2003 13:03:15 -0000	1.9
  @@ -1794,7 +1794,7 @@
       }    // end private abstract class DoubleOrderedMapIterator
   
       // final for performance
  -    private static final class Node implements Map.Entry {
  +    private static final class Node implements Map.Entry, KeyValue {
   
           private Comparable[] data;
           private Node[]       leftNode;
  
  
  
  1.6       +4 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/map/HashedMap.java
  
  Index: HashedMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/HashedMap.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HashedMap.java	3 Dec 2003 19:04:41 -0000	1.5
  +++ HashedMap.java	6 Dec 2003 13:03:15 -0000	1.6
  @@ -72,6 +72,7 @@
   
   import org.apache.commons.collections.IterableMap;
   import org.apache.commons.collections.IteratorUtils;
  +import org.apache.commons.collections.KeyValue;
   import org.apache.commons.collections.MapIterator;
   
   /**
  @@ -853,7 +854,7 @@
       /**
        * HashEntry
        */
  -    protected static class HashEntry implements Map.Entry {
  +    protected static class HashEntry implements Map.Entry, KeyValue {
           protected HashEntry next;
           protected int hashCode;
           protected Object key;
  
  
  
  1.2       +5 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java
  
  Index: StaticBucketMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StaticBucketMap.java	3 Dec 2003 15:16:49 -0000	1.1
  +++ StaticBucketMap.java	6 Dec 2003 13:03:15 -0000	1.2
  @@ -66,6 +66,8 @@
   import java.util.NoSuchElementException;
   import java.util.Set;
   
  +import org.apache.commons.collections.KeyValue;
  +
   /**
    * A StaticBucketMap is an efficient, thread-safe implementation of
    * <code>java.util.Map</code> that performs well in in a highly
  @@ -478,7 +480,7 @@
       /**
        * The Map.Entry for the StaticBucketMap.
        */
  -    private static final class Node implements Map.Entry {
  +    private static final class Node implements Map.Entry, KeyValue {
           protected Object key;
           protected Object value;
           protected Node next;
  
  
  
  1.3       +4 -3      jakarta-commons/collections/src/java/org/apache/commons/collections/map/ReferenceMap.java
  
  Index: ReferenceMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/ReferenceMap.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReferenceMap.java	5 Dec 2003 20:23:57 -0000	1.2
  +++ ReferenceMap.java	6 Dec 2003 13:03:15 -0000	1.3
  @@ -76,6 +76,7 @@
   import java.util.NoSuchElementException;
   import java.util.Set;
   
  +import org.apache.commons.collections.KeyValue;
   import org.apache.commons.collections.keyvalue.DefaultMapEntry;
   
   /**
  @@ -757,7 +758,7 @@
   
       // If getKey() or getValue() returns null, it means
       // the mapping is stale and should be removed.
  -    private class Entry implements Map.Entry {
  +    private class Entry implements Map.Entry, KeyValue {
   
           Object key;
           Object value;
  
  
  
  1.2       +6 -4      jakarta-commons/collections/src/java/org/apache/commons/collections/keyvalue/AbstractMapEntryDecorator.java
  
  Index: AbstractMapEntryDecorator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/keyvalue/AbstractMapEntryDecorator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractMapEntryDecorator.java	5 Dec 2003 20:23:56 -0000	1.1
  +++ AbstractMapEntryDecorator.java	6 Dec 2003 13:03:15 -0000	1.2
  @@ -59,6 +59,8 @@
   
   import java.util.Map;
   
  +import org.apache.commons.collections.KeyValue;
  +
   /**
    * Provides a base decorator that allows additional functionality to be added
    * to a Map Entry.
  @@ -68,7 +70,7 @@
    * 
    * @author Stephen Colebourne
    */
  -public abstract class AbstractMapEntryDecorator implements Map.Entry {
  +public abstract class AbstractMapEntryDecorator implements Map.Entry, KeyValue {
       
       /** The <code>Map.Entry</code> to decorate */
       protected final Map.Entry entry;
  @@ -81,7 +83,7 @@
        */
       public AbstractMapEntryDecorator(Map.Entry entry) {
           if (entry == null) {
  -            throw new IllegalArgumentException("Map entry must not be null");
  +            throw new IllegalArgumentException("Map Entry must not be null");
           }
           this.entry = entry;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org