org.apache.maven.mercury.artifact
Class MetadataTreeNode

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

public class MetadataTreeNode
extends java.lang.Object

metadata [dirty] Tree

Author:
Oleg Gusakov

Constructor Summary
MetadataTreeNode()
           
MetadataTreeNode(ArtifactMetadata md, MetadataTreeNode parent, ArtifactMetadata query)
          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(ArtifactMetadata query)
          dependencies are ordered in the POM - they should be added in the POM order
 int countDistinctNodes()
           
 int countNodes()
           
static int countNodes(MetadataTreeNode node)
           
 void createNames(int level, int seq)
           
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()
           
 java.lang.String getName()
           
 MetadataTreeNode getParent()
           
 java.util.List<ArtifactMetadata> getQueries()
           
 ArtifactMetadata getQuery()
           
 boolean hasChildren()
           
 boolean isOptional()
           
 boolean isReal()
           
static void reNumber(MetadataTreeNode node, int startNum)
           
 void setId(int id)
           
 void setParent(MetadataTreeNode parent)
           
 void setReal(boolean real)
           
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,
                        ArtifactMetadata query)
pointers to parent and query are a must.

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(ArtifactMetadata 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()

isReal

public boolean isReal()

setReal

public void setReal(boolean real)

getQuery

public ArtifactMetadata getQuery()

getQueries

public java.util.List<ArtifactMetadata> 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)

getName

public java.lang.String getName()

createNames

public void createNames(int level,
                        int seq)


Copyright © 2002-2010 Apache Software Foundation. All Rights Reserved.