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 2004/01/29 22:13:06 UTC

cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/bidimap TreeBidiMap.java

scolebourne    2004/01/29 13:13:06

  Modified:    collections/src/java/org/apache/commons/collections/bidimap
                        TreeBidiMap.java
  Log:
  Add javadoc about requiring Comparable entries
  bug 26470 from Jeff Skubick
  
  Revision  Changes    Path
  1.10      +23 -2     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TreeBidiMap.java	14 Jan 2004 21:43:16 -0000	1.9
  +++ TreeBidiMap.java	29 Jan 2004 21:13:05 -0000	1.10
  @@ -71,7 +71,8 @@
   import org.apache.commons.collections.keyvalue.UnmodifiableMapEntry;
   
   /**
  - * Red-Black tree-based implementation of BidiMap.
  + * Red-Black tree-based implementation of BidiMap where all objects added
  + * implement the <code>Comparable</code> interface.
    * <p>
    * This class guarantees that the map will be in both ascending key order
    * and ascending value order, sorted according to the natural order for
  @@ -170,6 +171,8 @@
   
       /**
        * Checks whether this map contains the a mapping for the specified key.
  +     * <p>
  +     * The key must implement <code>Comparable</code>.
        *
        * @param key  key whose presence in this map is to be tested
        * @return true if this map contains a mapping for the specified key
  @@ -183,6 +186,8 @@
   
       /**
        * Checks whether this map contains the a mapping for the specified value.
  +     * <p>
  +     * The value must implement <code>Comparable</code>.
        *
        * @param value  value whose presence in this map is to be tested
        * @return true if this map contains a mapping for the specified value
  @@ -197,6 +202,8 @@
       /**
        * Gets the value to which this map maps the specified key.
        * Returns null if the map contains no mapping for this key.
  +     * <p>
  +     * The key must implement <code>Comparable</code>.
        *
        * @param key  key whose associated value is to be returned
        * @return the value to which this map maps the specified key,
  @@ -223,6 +230,8 @@
        *  map.put("A","B");  // contains A mapped to B, as per Map
        *  map.put("C","B");  // contains C mapped to B, key A is removed
        * </pre>
  +     * <p>
  +     * Both key and value must implement <code>Comparable</code>.
        *
        * @param key  key with which the specified value is to be  associated
        * @param value  value to be associated with the specified key
  @@ -236,6 +245,8 @@
   
       /**
        * Puts all the mappings from the specified map into this map.
  +     * <p>
  +     * All keys and values must implement <code>Comparable</code>.
        * 
        * @param map  the map to copy from
        */
  @@ -249,6 +260,8 @@
           
       /**
        * Removes the mapping for this key from this map if present.
  +     * <p>
  +     * The key must implement <code>Comparable</code>.
        *
        * @param key  key whose mapping is to be removed from the map.
        * @return previous value associated with specified key,
  @@ -275,6 +288,8 @@
       /**
        * Returns the key to which this map maps the specified value.
        * Returns null if the map contains no mapping for this value.
  +     * <p>
  +     * The value must implement <code>Comparable</code>.
        *
        * @param value  value whose associated key is to be returned.
        * @return the key to which this map maps the specified value,
  @@ -288,6 +303,8 @@
   
       /**
        * Removes the mapping for this value from this map if present
  +     * <p>
  +     * The value must implement <code>Comparable</code>.
        *
        * @param value  value whose mapping is to be removed from the map
        * @return previous key associated with specified value,
  @@ -328,6 +345,8 @@
       
       /**
        * Gets the next key after the one specified.
  +     * <p>
  +     * The key must implement <code>Comparable</code>.
        *
        * @param key the key to search for next from
        * @return the next key, null if no match or at end
  @@ -340,6 +359,8 @@
   
       /**
        * Gets the previous key before the one specified.
  +     * <p>
  +     * The key must implement <code>Comparable</code>.
        *
        * @param key the key to search for previous from
        * @return the previous key, null if no match or at start
  
  
  

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