Codota Logo
TreeNode.getGraph
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
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

  • Start an intent from android
  • compareTo (BigDecimal)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now