org.apache.maven.mercury.metadata
Class MetadataTreeNode

java.lang.Object
  extended by org.apache.maven.mercury.metadata.MetadataTreeNode

public class MetadataTreeNode
extends java.lang.Object

metadata [dirty] Tree

Author:
Oleg Gusakov

Constructor Summary
MetadataTreeNode()
           
MetadataTreeNode(ArtifactMetadata md, MetadataTreeNode parent, ArtifactBasicMetadata query)
           
MetadataTreeNode(ArtifactMetadata md, MetadataTreeNode parent, ArtifactBasicMetadata query, boolean resolved)
          pointers to parent and query are a must.
 
Method Summary
 MetadataTreeNode addChild(MetadataTreeNode kid)
          dependencies are ordered in the POM - they should be added in the POM order
 MetadataTreeNode addQuery(ArtifactBasicMetadata query)
          dependencies are ordered in the POM - they should be added in the POM order
 int countDistinctNodes()
           
 int countNodes()
           
static int countNodes(MetadataTreeNode node)
           
static MetadataTreeNode deepCopy(MetadataTreeNode node)
           
 java.util.List<MetadataTreeNode> getChildren()
           
 int getDepth()
           
static void getDistinctNodes(MetadataTreeNode node, java.util.TreeSet<java.lang.String> nodes)
           
 int getId()
           
 int getMaxDepth(int depth)
           
 ArtifactMetadata getMd()
           
 MetadataTreeNode getParent()
           
 java.util.List<ArtifactBasicMetadata> getQueries()
           
 ArtifactBasicMetadata getQuery()
           
 boolean hasChildren()
           
 boolean isOptional()
           
static void reNumber(MetadataTreeNode node, int startNum)
           
 void setId(int id)
           
 void setParent(MetadataTreeNode parent)
           
static void showNode(MetadataTreeNode n, int level)
          helper method to print the tree into sysout
static void showNode(MetadataTreeNode n, int level, java.io.Writer wr)
          helper method to print the tree into a Writer
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetadataTreeNode

public MetadataTreeNode()

MetadataTreeNode

public MetadataTreeNode(ArtifactMetadata md,
                        MetadataTreeNode parent,
                        ArtifactBasicMetadata query,
                        boolean resolved)
pointers to parent and query are a must.


MetadataTreeNode

public MetadataTreeNode(ArtifactMetadata md,
                        MetadataTreeNode parent,
                        ArtifactBasicMetadata query)
Method Detail

countNodes

public int countNodes()

countNodes

public static int countNodes(MetadataTreeNode node)

countDistinctNodes

public int countDistinctNodes()

getDistinctNodes

public static void getDistinctNodes(MetadataTreeNode node,
                                    java.util.TreeSet<java.lang.String> nodes)

addChild

public MetadataTreeNode addChild(MetadataTreeNode kid)
dependencies are ordered in the POM - they should be added in the POM order


addQuery

public MetadataTreeNode addQuery(ArtifactBasicMetadata query)
dependencies are ordered in the POM - they should be added in the POM order


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasChildren

public boolean hasChildren()

getMd

public ArtifactMetadata getMd()

getParent

public MetadataTreeNode getParent()

getDepth

public int getDepth()

getMaxDepth

public int getMaxDepth(int depth)

setParent

public void setParent(MetadataTreeNode parent)

getChildren

public java.util.List<MetadataTreeNode> getChildren()

isOptional

public boolean isOptional()

getQuery

public ArtifactBasicMetadata getQuery()

getQueries

public java.util.List<ArtifactBasicMetadata> getQueries()

deepCopy

public static final MetadataTreeNode deepCopy(MetadataTreeNode node)

showNode

public static final void showNode(MetadataTreeNode n,
                                  int level,
                                  java.io.Writer wr)
                           throws java.io.IOException
helper method to print the tree into a Writer

Throws:
java.io.IOException

showNode

public static final void showNode(MetadataTreeNode n,
                                  int level)
                           throws java.io.IOException
helper method to print the tree into sysout

Throws:
java.io.IOException

getId

public int getId()

setId

public void setId(int id)

reNumber

public static void reNumber(MetadataTreeNode node,
                            int startNum)


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.