Package com.caucho.util

Examples of com.caucho.util.Tree


  }

  public void init(Env env, Element root, String base)
    throws Exception
  {
    tree = new Tree(null);

    this.root = root;
    if (base == null || base == "")
      base = "/";
View Full Code Here


    NavItem link = parent.findURL(test.getLink());

    if (link == null)
      return null;

    Tree parentTree = link.getTree();
    linkTree(link.getTree(), tree.getFirst());
    this.tree = parent.tree;

    return this;
  }
View Full Code Here

  {
    for (Tree child = subTree.getFirst();
         child != null;
         child = child.getNext()) {
      NavItem item = (NavItem) child.getData();
      Tree childTree = destTree.append(item);
      item.setTree(childTree);
      linkTree(childTree, child);
    }
  }
View Full Code Here

   
    url = normalizeURL(url);
   
    Iterator iter = tree.dfs();
    while (iter.hasNext()) {
      Tree tree = (Tree) iter.next();
      NavItem item = (NavItem) tree.getData();

      if (item.getLink().equals(url)) {
  return item;
      }
    }
View Full Code Here

      desc = descPattern.evalString(elt);
      item.setDescription(desc);

      item.setProduct(_productPattern.evalString(elt));

      Tree childTree = tree.append(item);
      item.setTree(childTree);

      fillChildren(env, childTree, childNode.getFirstChild(), base);
    }
  }
View Full Code Here

  public NavItem getParent()
  {
    if (tree == null)
      return null;
   
    Tree parent = tree.getParent();

    return parent == null ? null : (NavItem) parent.getData();
  }
View Full Code Here

  /**
   * Returns the previous sibling.
   */
  public NavItem getPrevious()
  {
    Tree prevTree = tree.getPrevious();
   
    if (prevTree == null)
      return null;
    else
      return (NavItem) prevTree.getData();
  }
View Full Code Here

  /**
   * Returns the previous item in a preorder DFS traversal.
   */
  public NavItem getPreviousPreorder()
  {
    Tree prevTree = tree.getPreviousPreorder();
   
    if (prevTree == null)
      return null;
    else
      return (NavItem) prevTree.getData();
  }
View Full Code Here

  /**
   * Returns the next sibling item.
   */
  public NavItem getNext()
  {
    Tree nextTree = tree.getNext();
   
    if (nextTree == null)
      return null;
    else
      return (NavItem) nextTree.getData();
  }
View Full Code Here

  /**
   * Returns the next item in a preorder DFS traversal.
   */
  public NavItem getNextPreorder()
  {
    Tree nextTree = tree.getNextPreorder();
   
    if (nextTree == null)
      return null;
    else
      return (NavItem) nextTree.getData();
  }
View Full Code Here

TOP

Related Classes of com.caucho.util.Tree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.