Documentation of 'edu.uci.ics.jung.graph.util.TreeUtils' Java class
TreeUtils
edu.uci.ics.jung.graph.util

Class TreeUtils



  • public class TreeUtils
    extends java.lang.Object
    Contains static methods for operating on instances of Tree.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TreeUtils() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static <V,E> void addFromSubTree(Forest<V,E> tree, Forest<V,E> subTree, E edge, V parent, V root) 
      static <V,E> void addSubTree(Forest<V,E> tree, Forest<V,E> subTree, V node, E connectingEdge)
      Connects subTree to tree by attaching it as a child of node with edge connectingEdge.
      static <V,E> java.util.List<V> getRoots(Forest<V,E> forest) 
      static <V,E> Tree<V,E> getSubTree(Forest<V,E> forest, V root)
      Returns the subtree of tree which is rooted at root as a Forest.
      static <V,E> void growSubTree(Forest<V,E> tree, Forest<V,E> subTree, V root)
      Populates subtree with the subtree of tree which is rooted at root.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TreeUtils

        public TreeUtils()
    • Method Detail

      • getRoots

        public static <V,E> java.util.List<V> getRoots(Forest<V,E> forest)
        Type Parameters:
        V - the vertex type
        E - the edge type
        Parameters:
        forest - the forest whose roots are to be returned
        Returns:
        the roots of this forest.
      • getSubTree

        public static <V,E> Tree<V,E> getSubTree(Forest<V,E> forest,
                                                 V root)
                                          throws java.lang.InstantiationException,
                                                 java.lang.IllegalAccessException
        Returns the subtree of tree which is rooted at root as a Forest. The tree returned is an independent entity, although it uses the same vertex and edge objects.
        Type Parameters:
        V - the vertex type
        E - the edge type
        Parameters:
        forest - the tree whose subtree is to be extracted
        root - the root of the subtree to be extracted
        Returns:
        the subtree of tree which is rooted at root
        Throws:
        java.lang.InstantiationException - if a new tree of the same type cannot be created
        java.lang.IllegalAccessException - if a new tree of the same type cannot be created
      • growSubTree

        public static <V,E> void growSubTree(Forest<V,E> tree,
                                             Forest<V,E> subTree,
                                             V root)
        Populates subtree with the subtree of tree which is rooted at root.
        Type Parameters:
        V - the vertex type
        E - the edge type
        Parameters:
        tree - the tree whose subtree is to be extracted
        subTree - the tree instance which is to be populated with the subtree of tree
        root - the root of the subtree to be extracted
      • addSubTree

        public static <V,E> void addSubTree(Forest<V,E> tree,
                                            Forest<V,E> subTree,
                                            V node,
                                            E connectingEdge)
        Connects subTree to tree by attaching it as a child of node with edge connectingEdge.
        Type Parameters:
        V - the vertex type
        E - the edge type
        Parameters:
        tree - the tree to which subTree is to be added
        subTree - the tree which is to be grafted on to tree
        node - the parent of subTree in its new position in tree
        connectingEdge - the edge used to connect subtree's root as a child of node
      • addFromSubTree

        public static <V,E> void addFromSubTree(Forest<V,E> tree,
                                                Forest<V,E> subTree,
                                                E edge,
                                                V parent,
                                                V root)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.