Tabnine Logo
TreeNode.getGraph
Code IndexAdd Tabnine to your IDE (free)

How to use
getGraph
method
in
phylo.tree.model.TreeNode

Best Java code snippets using phylo.tree.model.TreeNode.getGraph (Showing top 5 results out of 315)

origin: de.unijena.bioinf.phylo/flipcut-core

@Override
public long getEdgeWeight(TreeNode node) {
  Tree t = (Tree)node.getGraph();
  if (scaffoldTree != null && t.equals(scaffoldTree)) {
    return CutGraphCutter.getInfinity();
  } else {
    return 1;
  }
}
origin: de.unijena.bioinf.phylo/phyloTree-lib.model

Tree sourceTree = (Tree) character.getGraph();
TreeNode[] sourceTreeTaxa = sourceTree.getLeaves();
for (TreeNode taxon : sourceTreeTaxa) {
origin: de.unijena.bioinf.phylo/phyloTree-lib.model

if (a.getGraph() != t || b.getGraph() != t) return;
origin: de.unijena.bioinf.phylo/phyloTree-lib.model

/**
 * This method returns the last common ancestor of two nodes of a tree.
 * <p>
 * This eventually returns null if one of the given nodes is null or the given nodes
 * are not in this tree.
 *
 * @param nodeA
 * @param nodeB
 * @return the LCA of nodeA and nodeB or null if no LCA exists
 */
public TreeNode findLeastCommonAncestor(TreeNode nodeA, TreeNode nodeB) {
  if (nodeA == null || nodeB == null) return null;
  if (nodeA.getGraph() != this || nodeB.getGraph() != this) return null;
  /* set nodeA and nodeB to equal level */
  if (nodeA.getLevel() < nodeB.getLevel()) {
    while (nodeA.getLevel() != nodeB.getLevel()) {
      nodeB = (TreeNode) nodeB.getParent();
    }
  } else {
    while (nodeA.getLevel() != nodeB.getLevel()) {
      nodeA = (TreeNode) nodeA.getParent();
    }
  }
  /* set both nodes to their parent, until they are equal */
  while (nodeA != nodeB) {
    nodeA = (TreeNode) nodeA.getParent();
    nodeB = (TreeNode) nodeB.getParent();
  }
  return (nodeA);
}
origin: de.unijena.bioinf.phylo/flipcut-core

Tree tree = (Tree) node.getGraph();
if (scaffoldTree != null && tree.equals(scaffoldTree)) {
  return CutGraphCutter.getInfinity();
phylo.tree.modelTreeNodegetGraph

Popular methods of TreeNode

  • <init>
    Create a new node with given label
  • childCount
    Returns the number of children of this node.
  • depthFirstIterator
    Returns a depth first Iterable. This enables iterating the subtree rooted at this node in post order
  • getLabel
    The label of this node. If the label is not set, this looks for a label property TreeNodeProperties#
  • getParent
    Return the parent of this node.
  • isInnerNode
    Returns true if this is not a leaf.
  • isLeaf
    Returns true if this node is a leaf.
  • children
    Returns an Iterable over all children of this node. This allow using nodes in foreach loop: for(Tre
  • getChildren
    Get a list of all children of this node. It is helpful if one wants to iterate over all children and
  • getEdgeToParent
    Return the edge to the parent node or null.
  • getLevel
    Lazy and one time computation of the level of this node.
  • getDistanceToParent
    Returns the distance to the parent node. If the node has no parent (root node ) -1 is returned.
  • getLevel,
  • getDistanceToParent,
  • getLeaves,
  • setLabel,
  • cloneNode,
  • equalsNode,
  • getChildAt,
  • getIndex,
  • getPartition

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JPanel (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now