mstover1    2004/04/16 06:06:36

  Modified:    src/jorphan/org/apache/jorphan/collections Tag: rel-2_0
                        HashTree.java
  Log:
  Quick enhancement to HashTree
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.14.2.1  +11 -6     
jakarta-jmeter/src/jorphan/org/apache/jorphan/collections/HashTree.java
  
  Index: HashTree.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/jorphan/org/apache/jorphan/collections/HashTree.java,v
  retrieving revision 1.14
  retrieving revision 1.14.2.1
  diff -u -r1.14 -r1.14.2.1
  --- HashTree.java     24 Mar 2004 15:23:37 -0000      1.14
  +++ HashTree.java     16 Apr 2004 13:06:36 -0000      1.14.2.1
  @@ -432,10 +432,10 @@
        * @param key   key to be added
        * @param value value to be added as a key in the secondary node
        */
  -    public void add(Object key, Object value)
  +    public HashTree add(Object key, Object value)
       {
           add(key);
  -        getTree(key).add(value);
  +        return getTree(key).add(value);
       }
       
       /**
  @@ -503,6 +503,11 @@
           }
       }
       
  +    public HashTree add(Object[] treePath,Object value)
  +    {
  +        return add(Arrays.asList(treePath),value);
  +    }
  +    
       /**
        * Adds a series of nodes into the HashTree using the given path.  The
        * first argument is a List that represents a path to a specific node in
  @@ -529,10 +534,10 @@
        * @param treePath   a list of objects representing a path
        * @param value  Object to add as a node to bottom-most node
        */
  -    public void add(Collection treePath, Object value)
  +    public HashTree add(Collection treePath, Object value)
       {
           HashTree tree = addTreePath(treePath);
  -        tree.add(value);
  +        return tree.add(value);
       }
       
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to