/** Leaves can be used for many-to-many relations */ public void deleteLeaves(String name) { for (int i = 0; i < _leaves.size(); i++) { CatalogTreeLeaf leaf = _leaves.get(i); if (name.equals(leaf.getName())) { _leaves.remove(i); } } }
public CatalogTreeLeaf getLeaf(String name, String path) { for (int i = 0; i < _leaves.size(); i++) { CatalogTreeLeaf leaf = _leaves.get(i); if (name.equals(leaf.getName()) && path.equals(leaf.getPath())) { return leaf; } } return null; }
public void deleteLeaf(String name, String path) { for (int i = 0; i < _leaves.size(); i++) { CatalogTreeLeaf leaf = _leaves.get(i); if (name.equals(leaf.getName()) && path.equals(leaf.getPath())) { _leaves.remove(i); return; } } }
/** Leaves can be used for many-to-many relations */ public ArrayList<CatalogTreeLeaf> getLeaves(String name) { ArrayList<CatalogTreeLeaf> leaves = new ArrayList<CatalogTreeLeaf>(); for (int i = 0; i < _leaves.size(); i++) { CatalogTreeLeaf leaf = _leaves.get(i); if (name.equals(leaf.getName())) { leaves.add(leaf); } } return leaves; }