org.apache.activemq.apollo.util.path
Class PathMapNode<Value>

java.lang.Object
  extended by org.apache.activemq.apollo.util.path.PathMapNode<Value>
All Implemented Interfaces:
PathNode<Value>

public class PathMapNode<Value>
extends java.lang.Object
implements PathNode<Value>

An implementation class used to implement PathMap

Version:
$Revision: 1.2 $

Constructor Summary
PathMapNode(PathMapNode<Value> parent)
           
 
Method Summary
 void add(Path path, int idx, Value value)
           
 void appendDescendantValues(java.util.Set<Value> answer)
           
 void appendMatchingValues(java.util.Set<Value> answer, Path path, int startIndex)
           
 void appendMatchingWildcards(java.util.Set<Value> answer, Path parts, int idx)
          Matches any entries in the map containing wildcards
protected  PathMapNode<Value> createChildNode()
          Factory method to create a child node
 PathMapNode<Value> getChild(Part part)
          Returns the child node for the given named path or null if it does not exist
 int getChildCount()
           
 PathMapNode<Value> getChildOrCreate(Part part)
          Returns the child node for the given named path, lazily creating one if it does not yet exist
 java.util.Collection<PathNode<Value>> getChildren()
          Returns the child nodes
 java.util.Set<Value> getDesendentValues()
          Returns a list of all the values from this node down the tree
 Part getPart()
           
 java.util.List<Value> getValues()
          Returns a mutable List of the values available at this node in the tree
protected  void pruneIfEmpty()
           
 boolean remove(Path path, int idx, Value value)
           
 void removeAll(java.util.Set<Value> answer, Path path, int startIndex)
           
protected  void removeChild(PathMapNode<Value> node)
           
 java.util.Set<Value> removeDesendentValues()
           
protected  void removeDesendentValues(java.util.Set<Value> answer)
           
 java.util.List<Value> removeValues()
          Returns a mutable List of the values available at this node in the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathMapNode

public PathMapNode(PathMapNode<Value> parent)
Method Detail

getChild

public PathMapNode<Value> getChild(Part part)
Returns the child node for the given named path or null if it does not exist

Specified by:
getChild in interface PathNode<Value>

getChildren

public java.util.Collection<PathNode<Value>> getChildren()
Returns the child nodes

Specified by:
getChildren in interface PathNode<Value>

getChildCount

public int getChildCount()

getChildOrCreate

public PathMapNode<Value> getChildOrCreate(Part part)
Returns the child node for the given named path, lazily creating one if it does not yet exist


getValues

public java.util.List<Value> getValues()
Returns a mutable List of the values available at this node in the tree

Specified by:
getValues in interface PathNode<Value>

removeValues

public java.util.List<Value> removeValues()
Returns a mutable List of the values available at this node in the tree

Specified by:
removeValues in interface PathNode<Value>

removeDesendentValues

public java.util.Set<Value> removeDesendentValues()
Specified by:
removeDesendentValues in interface PathNode<Value>

removeDesendentValues

protected void removeDesendentValues(java.util.Set<Value> answer)

getDesendentValues

public java.util.Set<Value> getDesendentValues()
Returns a list of all the values from this node down the tree

Specified by:
getDesendentValues in interface PathNode<Value>

add

public void add(Path path,
                int idx,
                Value value)

remove

public boolean remove(Path path,
                      int idx,
                      Value value)

removeAll

public void removeAll(java.util.Set<Value> answer,
                      Path path,
                      int startIndex)

appendDescendantValues

public void appendDescendantValues(java.util.Set<Value> answer)
Specified by:
appendDescendantValues in interface PathNode<Value>

createChildNode

protected PathMapNode<Value> createChildNode()
Factory method to create a child node


appendMatchingWildcards

public void appendMatchingWildcards(java.util.Set<Value> answer,
                                    Path parts,
                                    int idx)
Matches any entries in the map containing wildcards

Specified by:
appendMatchingWildcards in interface PathNode<Value>

appendMatchingValues

public void appendMatchingValues(java.util.Set<Value> answer,
                                 Path path,
                                 int startIndex)
Specified by:
appendMatchingValues in interface PathNode<Value>

getPart

public Part getPart()

pruneIfEmpty

protected void pruneIfEmpty()

removeChild

protected void removeChild(PathMapNode<Value> node)


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.