/** * INTERNAL makeNodeOneToMany: * Traverse to the leaf on theNode and mark as one to many */ public void makeNodeOneToMany(Node theNode) { Node currentNode = theNode; do { if (!currentNode.hasRight()) { ((AttributeNode)currentNode).setRequiresCollectionAttribute(true); return; } currentNode = currentNode.getRight(); } while (true); }
/** * INTERNAL makeNodeOneToMany: * Traverse to the leaf on theNode and mark as one to many */ public void makeNodeOneToMany(Node theNode) { Node currentNode = theNode; do { if (!currentNode.hasRight()) { ((AttributeNode)currentNode).setRequiresCollectionAttribute(true); return; } currentNode = currentNode.getRight(); } while (true); }
/** * INTERNAL makeNodeOneToMany: * Traverse to the leaf on theNode and mark as one to many */ public void makeNodeOneToMany(Node theNode) { Node currentNode = theNode; do { if (!currentNode.hasRight()) { ((AttributeNode)currentNode).setRequiresCollectionAttribute(true); return; } currentNode = currentNode.getRight(); } while (true); }
public String toString(int indent) { StringBuilder buffer = new StringBuilder(); buffer.append(toStringDisplayName()); buffer.append("\r\n"); toStringIndent(indent, buffer); if (hasLeft()) { buffer.append("Left: " + getLeft().toString(indent + 1)); } else { buffer.append("Left: null"); } buffer.append("\r\n"); toStringIndent(indent, buffer); if (hasRight()) { buffer.append("Right: " + getRight().toString(indent + 1)); } else { buffer.append("Right: null"); } return buffer.toString(); }
public String toString(int indent) { StringBuilder buffer = new StringBuilder(); buffer.append(toStringDisplayName()); buffer.append("\r\n"); toStringIndent(indent, buffer); if (hasLeft()) { buffer.append("Left: " + getLeft().toString(indent + 1)); } else { buffer.append("Left: null"); } buffer.append("\r\n"); toStringIndent(indent, buffer); if (hasRight()) { buffer.append("Right: " + getRight().toString(indent + 1)); } else { buffer.append("Right: null"); } return buffer.toString(); }
public String toString(int indent) { StringBuffer buffer = new StringBuffer(); buffer.append(toStringDisplayName()); buffer.append("\r\n"); toStringIndent(indent, buffer); if (hasLeft()) { buffer.append("Left: " + getLeft().toString(indent + 1)); } else { buffer.append("Left: null"); } buffer.append("\r\n"); toStringIndent(indent, buffer); if (hasRight()) { buffer.append("Right: " + getRight().toString(indent + 1)); } else { buffer.append("Right: null"); } return buffer.toString(); }
public int findNodeN(Node node, int n, int callNumber) //Call initially with findNodeN(tree.getRoot(), n, 0) { if (node.hasLeft()) findNodeN(node.getLeftChild(), n, callNumber); if (callNumber == n) return node.getElement(); else callNumber++; if (node.hasRight()) printTreeInOrder(node.getRightChild(), n, callNumber); }