Classifies the areas in an area tree.

@param root the root node of the area tree
503329
public void classifyTree(Area root, FeatureExtractor features)
	{
	    if (classifier != null)
	    {
	        System.out.print("tree visual classification...");
	        testRoot = root;
	        this.features = features;
    	    //create a new empty set with the same header as the training set
    	    testset = new Instances(trainset, 0);
    	    //create an empty mapping
    	    mapping = new HashMap<Area, Instance>();
    	    //fill the set with the data
    	    recursivelyExtractAreaData(testRoot);
    	    System.out.println("done");
	    }
	}
1142132
private void filterBranches(final Element root) {
        final QName[][] props = getExtProps(root.getAttribute(ATTRIBUTE_NAME_DOMAINS));
        final SubjectScheme subjectSchemeMap = getSubjectScheme(root);
        final List<FilterUtils> baseFilter = getBaseFilter(subjectSchemeMap);
        filterBranches(root, baseFilter, props, subjectSchemeMap);
    }
1189986
private void dfs(Node root) {
        root.setMarked(true);
        for (Edge e : root.getOutEdges()) {
            N n = e.getChild();
            if (!n.isMarked()) {
                dfs(n);
            }
        }
    }
579650
public void add (Area area) {
        if (area == null || area.isEmpty()) {
            return;
        } else if (isEmpty()) {
            copy(area, this);
            return;
        }

        if (isPolygonal() && area.isPolygonal()) {
            addPolygon(area);
        } else {
            addCurvePolygon(area);
        }

        if (areaBoundsSquare() < GeometryUtil.EPSILON) {
            reset();
        }
    }
93497
public static <E> void rootElement(WebElement root, E element) {
		if (element == null || root == null) return;
		if (element instanceof WebElement) return;
		
		for (Class<?> clazz = element.getClass(); !clazz.equals(Object.class);
				clazz = clazz.getSuperclass()) {
			
			if (Enhancer.isEnhanced(clazz)) continue;
			
			Field[] fields = clazz.getDeclaredFields();
			for (Field field : fields) {
				setRootElementField(root, element, field);
			}
		}
	}
178824
private void parseTerritoryContainment(JsonObject root) {
    JsonObject node = resolve(root, "supplemental", "territoryContainment");
    for (Map.Entry<String, JsonElement> entry : node.entrySet()) {
      String parentCode = entry.getKey();
      if (parentCode.contains("-")) {
        if (!parentCode.endsWith("-status-grouping")) {
          continue;
        }
        parentCode = parentCode.split("-")[0];
      }
      
      JsonObject value = entry.getValue().getAsJsonObject();
      JsonArray elements = (JsonArray) value.get("_contains");
      if (elements == null) {
        throw new RuntimeException("Unexpected object structure: " + value);
      }

      List<String> children = new ArrayList<>();
      for (JsonElement element : elements) {
        String code = element.getAsString();
        children.add(code);
      }
      
      Set<String> regions = territoryContainment.get(parentCode);
      if (regions == null) {
        regions = new TreeSet<>();
        territoryContainment.put(parentCode, regions);
      }
      regions.addAll(children);
    }
  }
936746
private void transform(JSONArray root) {
        for (int i = 0, size = root.size(); i < size; i++)
        {
            Object target = root.get(i);
            if (target instanceof JSONObject)
                this.transform((JSONObject)target);
        }
    }
1305925
public void setRoot(int context, Object environment)
  {
    super.setRoot(context, environment);
    m_traverser = m_cdtm.getAxisTraverser(m_axis);
    
    String localName = getLocalName();
    String namespace = getNamespace();
    int what = m_whatToShow;
    // System.out.println("what: ");
    // NodeTest.debugWhatToShow(what);
    if(DTMFilter.SHOW_ALL == what
       || NodeTest.WILD.equals(localName)
       || NodeTest.WILD.equals(namespace))
    {
      m_extendedTypeID = 0;
    }
    else
    {
      int type = getNodeTypeTest(what);
      m_extendedTypeID = m_cdtm.getExpandedTypeID(namespace, localName, type);
    }
    
  }
1364720
public void setTree(CmsTree<CmsTreeItem> tree) {

        m_tree = tree;
        for (Widget widget : m_children) {
            if (widget instanceof CmsTreeItem) {
                ((CmsTreeItem)widget).setTree(tree);
            }
        }
    }
392544
public void visitTopLevel(JCCompilationUnit tree) {
        tree.pid = translate(tree.pid);
        tree.defs = translate(tree.defs);
        result = tree;
    }
1173865
private void buildForest(Instance inst)
	{
		this.dimensions = inst.numAttributes();
		double[]max = new double[dimensions];
		double[]min = new double[dimensions];
		double sq;
		
		for (int i = 0 ; i < this.numTrees ; i++)
		{
			for(int j = 0 ; j < this.dimensions ; j++)
			{
				sq = this.classifierRandom.nextDouble();
				min[j] = sq - (2.0*Math.max(sq, 1.0-sq));
				max[j] = sq + (2.0*Math.max(sq, 1.0-sq));
			}

			forest[i] = new HSTreeNode(min, max, 1, maxDepth);
		}
	}
767643
@Pure
	public static Map<ShapeElementType, MapElementGroup> classifiesElements(Iterator<? extends MapElement> elements) {
		final Map<ShapeElementType, MapElementGroup> classification = new TreeMap<>();
		classifiesElements(classification, elements);
		return classification;
	}
1221263
public static void collapseAll(JTree tree, boolean omitRoot)
    {
        int rows = tree.getRowCount();
        int limit = (omitRoot ? 1 : 0);
        for (int i = rows - 1; i >= limit; i--)
        {
            tree.collapseRow(i);
        }
    }
400715
public void traverse(Node root) {
    try {
      initTraversal(root);
      curNode = root;
      pushScope(root);
      // null parent ensures that the shallow callbacks will traverse root
      traverseBranch(root, null);
      popScope();
    } catch (Error | Exception unexpectedException) {
      throwUnexpectedException(unexpectedException);
    }
  }
409097
protected void layout(TreeNode node) {
    if (node != null) {
      TreeNode child = node.child;

      while (child != null) {
        layout(child);
        child = child.next;
      }

      if (node.child != null) {
        attachParent(node, join(node));
      } else {
        layoutLeaf(node);
      }
    }
  }
859997
private static List parseAttributes(Node root) throws ParsingException {
        List set = new ArrayList();

        // the Environment section is just a list of Attributes
        NodeList nodes = root.getChildNodes();
        for (int i = 0; i < nodes.getLength(); i++) {
            Node node = nodes.item(i);
            if (SunxacmlUtil.getNodeName(node).equals("Attribute"))
                set.add(BasicAttribute.getInstance(node));
        }

        return set;
    }
413353
@Override
    public void delete(Key key) {
	// TODO check whether this needs to be checked!!
	if (!contains(key)) {
	    return;
	}

	// if both children of root are black, set root to red
	if (!isRed(root.getLeft()) && !isRed(root.getRight())) {
	    root.setColor(RED);
	}

	root = delete(root, key);
	if (!isEmpty()) {
	    root.setParent(null);
	    root.setColor(BLACK);
	}
	// assert check();
    }