public TestTreeObject findNode(final String myName) { if (name.equals(myName)) { return this; } TestTreeObject result; for (final TestTreeObject obj : children) { if ((result = obj.findNode(myName)) != null) { return result; } } return null; }
// updates type public void updateType() { if (children.size() == 0) { return; } type = TestTreeObject.SUCCESS; for (final TestTreeObject child : children) { if (child.getType() != TestTreeObject.SUCCESS) { type = TestTreeObject.WARN; } } }
public void addChild(final TestTreeObject child) { child.setParent(this); children.add(child); }