public CarnotTreeNode findFirst(Object object) { for (Enumeration e = depthFirstEnumeration(); e.hasMoreElements(); ) { CarnotTreeNode node = (CarnotTreeNode) e.nextElement(); if (node.getUserObject() == object) { return node; } } return null; }
public CarnotTreeNode getNode(Object element) { for (int i = 0; i < getChildCount(); i++) { CarnotTreeNode node = (CarnotTreeNode) children.get(i); if (node.getUserObject() == element) { return node; } } return null; }
public Iterator findAll(final Object object) { ArrayList list = new ArrayList(); for (Enumeration e = depthFirstEnumeration(); e.hasMoreElements(); ) { CarnotTreeNode node = (CarnotTreeNode) e.nextElement(); if (node.getUserObject() == object) { list.add(node); } } return list.iterator(); }