Examples of TreeNode


Examples of CtCILibrary.TreeNode

public class Question
  public static void main(String[] args) {
    int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
   
    // We needed this code for other files, so check out the code in the library
    TreeNode root = TreeNode.createMinimalBST(array);
    System.out.println("Root? " + root.data);
    System.out.println("Created BST? " + root.isBST());
    System.out.println("Height: " + root.height());
  }
View Full Code Here

Examples of adt.tree.TreeNode

import adt.tree.TreeNode;

public class Q023_Foldable_Binary_Trees {

  public static void main(String[] args) {
    TreeNode root = Tree.tree1();
    boolean res = isFoldable(root);
    System.out.println(res);
  }
View Full Code Here

Examples of com.barrybecker4.common.expression.TreeNode

                token += ch;
            }
            else if (opDef.isOperator(ch)) {
                pushNodesForToken(token, nodes);
                token = "";
                nodes.add(new TreeNode(ch, opDef));
            }
            else {
                throw new Error("Unexpected character " + ch +" in expression: " + exp);
            }
            pos++;
View Full Code Here

Examples of com.customized.tools.cli.TreeNode

   
    for(String key : delegate.getGenericCache().keySet()) {
      String lifespan = delegate.getGenericCache().getAdvancedCache().getDataContainer().get(key).getLifespan() + "";
      String maxIdle = delegate.getGenericCache().getAdvancedCache().getDataContainer().get(key).getMaxIdle() + "";
      CacheEntry entity = new CacheEntry(key, delegate.getGenericCache().get(key), lifespan, maxIdle,alias);
      TreeNode node = new TreeNode(key, entity.toString(), getCurrentNode(), null);
      addTreeNode(node);
    }
  }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.treegrid.TreeGrid.TreeNode

    event.setCancelled(false);
  }

  @Override
  protected void showFeedback(DNDEvent event) {
    final TreeNode item = treeGrid.findNode(event.getTarget());
    if (item == null) {
      if (activeItem != null) {
        clearStyle(activeItem);
      }
    }

    if (item != null && event.getDropTarget().component == event.getDragSource().component) {
      TreeGrid source = (TreeGrid) event.getDragSource().component;
      List<ModelData> list = source.getSelectionModel().getSelection();
      ModelData overModel = item.getModel();
      for (int i = 0; i < list.size(); i++) {
        ModelData sel = list.get(i);
        if (overModel == sel) {
          Insert.get().hide();
          event.getStatus().setStatus(false);
          return;
        }
        List<ModelData> children = treeGrid.getTreeStore().getChildren(sel, true);
        if (children.contains(item.getModel())) {
          Insert.get().hide();
          event.getStatus().setStatus(false);
          return;
        }
      }
    }

    boolean append = feedback == Feedback.APPEND || feedback == Feedback.BOTH;
    boolean insert = feedback == Feedback.INSERT || feedback == Feedback.BOTH;

    if (item == null) {
      handleAppend(event, item);
    } else if (insert) {
      handleInsert(event, item);
    } else if ((!item.isLeaf() || allowDropOnLeaf) && append) {
      handleAppend(event, item);
    } else {
      if (activeItem != null) {
        clearStyle(activeItem);
      }
View Full Code Here

Examples of com.extjs.gxt.ui.client.widget.treepanel.TreePanel.TreeNode

  }

  @Override
  @SuppressWarnings({"unchecked", "rawtypes"})
  protected void onDragStart(DNDEvent e) {
    TreeNode n = tree.findNode((Element) e.getDragEvent().getStartElement());
    if (n == null) {
      e.setCancelled(true);
      return;
    }
    ModelData m = n.getModel();
    if (!tree.getView().isSelectableTarget(m, (Element) e.getDragEvent().getStartElement())) {
      e.setCancelled(true);
      return;
    }
View Full Code Here

Examples of com.fasterxml.jackson.core.TreeNode

   
    // [Issue-11]: simple cast, for Tree
    public void testNodeConvert() throws Exception
    {
        ObjectNode src = (ObjectNode) MAPPER.readTree("{}");
        TreeNode node = src;
        ObjectNode result = MAPPER.treeToValue(node, ObjectNode.class);
        // should just cast...
        assertSame(src, result);
    }
View Full Code Here

Examples of com.google.gwt.dev.js.FlatteningVisitor.TreeNode

* A visitor that comparares two Js AST trees and fails if they are different.
*/
public class ComparingVisitor extends JsVisitor {

  public static void exec(List<JsStatement> expected, List<JsStatement> actual) {
    TreeNode expectedTree = FlatteningVisitor.exec(expected);
    TreeNode actualTree = FlatteningVisitor.exec(actual);
    compare(expectedTree, actualTree);
  }
View Full Code Here

Examples of com.google.gwt.user.cellview.client.TreeNode

                uriLabel.setHTML(SELECTED_URI_PREFIX + entry.getURI());
            }
        });

        // open first element
        TreeNode rootNode = tree.getRootTreeNode();
        TreeNode firstItem = rootNode.setChildOpen(0, true);

    }
View Full Code Here

Examples of com.googlecode.objectify.test.LoadParentRefTests.TreeNode

  @Test
  public void testTwoLevelsOfFetch() throws Exception
  {
    fact().register(TreeNode.class);

    TreeNode node1 = new TreeNode();
    node1.foo = "foo1";
    ofy().save().entity(node1).now();

    TreeNode node2 = new TreeNode();
    node2.parent = Ref.create(node1);
    node2.foo = "foo2";
    ofy().save().entity(node2).now();

    TreeNode node3 = new TreeNode();
    node3.parent = Ref.create(node2);
    node3.foo = "foo3";
    ofy().save().entity(node3).now();

    TreeNode fetched3 = ofy().load().entity(node3).now();

    assert fetched3.foo.equals(node3.foo);
    assert fetched3.parent.get().id.equals(node2.id);
    assert fetched3.parent.get().foo.equals(node2.foo);
    assert fetched3.parent.get().parent.get().id.equals(node1.id);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.