All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.puresoltechnologies.graphs.trees.Tree Maven / Gradle / Ivy

package com.puresoltechnologies.graphs.trees;

import com.puresoltechnologies.graphs.graph.CycleAnalyzer;
import com.puresoltechnologies.graphs.graph.Graph;
import com.puresoltechnologies.graphs.graph.SubgraphAnalyzer;

/**
 * This is the interface for a Tree {@link Graph}. This interface is to be seen
 * as a wrapper to make a tree to a graph to use graph functions.
 * 
 * A valid implementation and assignment of a tree has the condition that
 * {@link CycleAnalyzer#hasCycles(Graph, boolean)} returns false
 * and {@link SubgraphAnalyzer#hasDisconnectedSubgraph(Graph)} returns false,
 * too. Additionally, the node returned by {@link #getRootNode()} must not have
 * a parent.
 * 
 * @author Rick-Rainer Ludwig
 *
 * @param 
 *            is the actual {@link TreeNode} implementation.
 */
public interface Tree> extends Graph> {

    /**
     * This method returns the root node of the tree. The root node of the tree is
     * the one and only node which does not have a parent.
     * 
     * @return An object of N is returned containing the reference to the root node
     *         of the tree.
     */
    public N getRootNode();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy