[jboss-cvs] JBossCache/src/org/jboss/cache ...

Manik Surtani msurtani at jboss.com
Wed Oct 18 07:59:16 EDT 2006


  User: msurtani
  Date: 06/10/18 07:59:16

  Modified:    src/org/jboss/cache   Node.java TreeCacheProxyImpl.java
  Log:
  * added getChildrenNames()
  
  Revision  Changes    Path
  1.48      +7 -3      JBossCache/src/org/jboss/cache/Node.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Node.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Node.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -b -r1.47 -r1.48
  --- Node.java	20 Sep 2006 16:28:58 -0000	1.47
  +++ Node.java	18 Oct 2006 11:59:16 -0000	1.48
  @@ -6,7 +6,6 @@
    */
   package org.jboss.cache;
   
  -import java.util.Collection;
   import java.util.Map;
   import java.util.Set;
   
  @@ -28,9 +27,14 @@
      Node getParent();
   
      /**
  -    * @return an immutable {@link Collection} of child nodes.  Empty {@link Collection} if there aren't any children.
  +    * @return an immutable {@link Set} of child nodes.  Empty {@link Set} if there aren't any children.
       */
  -   Collection<Node> getChildren();
  +   Set<Node> getChildren();
  +
  +   /**
  +    * @return an immutable {@link Set} of child node names.  Empty {@link Set} if there aren't any children.
  +    */
  +   Set<Object> getChildrenNames();
   
      /**
       * @return a {@link Map} containing the data in this {@link Node}.  If there is no data, an empty {@link Map} is returned.  The {@link Map} returned is always immutable.
  
  
  
  1.44      +11 -4     JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TreeCacheProxyImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/TreeCacheProxyImpl.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -b -r1.43 -r1.44
  --- TreeCacheProxyImpl.java	16 Oct 2006 10:55:40 -0000	1.43
  +++ TreeCacheProxyImpl.java	18 Oct 2006 11:59:16 -0000	1.44
  @@ -21,8 +21,8 @@
   
   import javax.transaction.Transaction;
   import javax.transaction.TransactionManager;
  -import java.util.Collection;
   import java.util.Collections;
  +import java.util.HashMap;
   import java.util.HashSet;
   import java.util.Iterator;
   import java.util.List;
  @@ -287,7 +287,7 @@
         return new TreeCacheProxyImpl(treeCache, (NodeImpl) currentNode.getParent());
      }
   
  -   public Collection<Node> getChildren()
  +   public Set<Node> getChildren()
      {
         Map m = currentNode.getChildren();
         Set<Node> children = new HashSet<Node>(m.size());
  @@ -300,6 +300,13 @@
         return Collections.unmodifiableSet(children);
      }
   
  +   public Set<Object> getChildrenNames()
  +   {
  +      Set s = currentNode.getChildren().keySet();
  +      Set<Object> children = new HashSet<Object>(s);
  +      return Collections.unmodifiableSet(children);
  +   }
  +
      public void setChildren(Map<Object, Node> children)
      {
         currentNode.setChildren(children);
  @@ -307,12 +314,12 @@
   
      public Map getData()
      {
  -      return Collections.unmodifiableMap(currentNode.getData());
  +      return Collections.unmodifiableMap(new HashMap(currentNode.getData()));
      }
   
      public Set getKeys()
      {
  -      return Collections.unmodifiableSet(currentNode.getDataKeys());
  +      return Collections.unmodifiableSet(new HashSet(currentNode.getDataKeys()));
      }
   
      public Fqn getFqn()
  
  
  



More information about the jboss-cvs-commits mailing list