commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections SequencedHashMap.java
Date Fri, 22 Feb 2002 02:34:59 GMT
mas         02/02/21 18:34:59

  Modified:    collections/src/java/org/apache/commons/collections
                        SequencedHashMap.java
  Log:
  There is no backwards compatibility issue since this class is new
  since collections 1.0.  Therefore, since the entire Map interface
  is implemented, there's no reason to inherit from HashMap.
  
  Revision  Changes    Path
  1.5       +8 -14     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SequencedHashMap.java	21 Feb 2002 13:46:25 -0000	1.4
  +++ SequencedHashMap.java	22 Feb 2002 02:34:59 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/SequencedHashMap.java,v
1.4 2002/02/21 13:46:25 mas Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/02/21 13:46:25 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/SequencedHashMap.java,v
1.5 2002/02/22 02:34:59 mas Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/02/22 02:34:59 $
    *
    * ====================================================================
    *
  @@ -78,15 +78,6 @@
    *  which they were added.  This data structure has fast <I>O(1)</I> search
    *  time, deletion time, and insertion time.
    *
  - *  This class inherits from {@link java.util.HashMap} purely for backwards
  - *  compatibility.  It should really be inheriting from {@link
  - *  java.util.AbstractMap}, or with a tiny extra bit of work, implement the
  - *  full map interface on its own. APIs should not rely on this class being an
  - *  actual {@link java.util.HashMap}, and instead should recognize it only as a
  - *  generic {@link java.util.Map} (unless, of course, you need the sequencing
  - *  functionality, but even in that case, this class should not be referred to
  - *  as a java.util.HashMap).
  - *
    *  <P>Although this map is sequenced, it cannot implement {@link
    *  java.util.List} because of incompatible interface definitions.  The remove
    *  methods in List and Map have different return values (see: {@link
  @@ -100,7 +91,7 @@
    * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
    * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    */
  -public class SequencedHashMap extends HashMap {
  +public class SequencedHashMap implements Map, Cloneable {
   
     /**
      *  {@link java.util.Map.Entry} that doubles as a node in the linked list
  @@ -734,8 +725,11 @@
      * <code>clone()</code>'d.  The cloned object maintains the same sequence.
      *
      * @return A clone of this instance.  
  +   *
  +   * @exception CloneNotSupportedException if clone is not supported by a
  +   * subclass.
      */
  -  public Object clone () {
  +  public Object clone () throws CloneNotSupportException {
       // yes, calling super.clone() silly since we're just blowing away all
       // the stuff that super might be doing anyway, but for motivations on
       // this, see:
  
  
  

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


Mime
View raw message