public Node<T> getNode(T containing) { Node<T> parentNode = map.get(containing); if (parentNode != null) { return parentNode; } else { return hierarchyInfo.createNode(Collections.singleton(containing)); } }
private void addCycles(HashSet<Set<T>> forCycles) { for (Set<T> entity : forCycles) { DefaultNode<T> node = createNode(entity); for (T cls : entity) { cycles.put(cls, node); Set<T> rawSupers = new HashSet<T>(rawHierarchyProvider.getParents(cls)); rawSupers.removeAll(node.getEntities()); if (rawSupers.isEmpty()) { roots.add(cls); } } } roots.remove(topEntity); }
public Node<T> getEquivalents(T element) { Node<T> node = cycles.get(element); if (node == null) { DefaultNode<T> newNode = createNode(); newNode.add(element); node = newNode; } return node; } }
public void addNode(Set<T> elements) { addNode(hierarchyInfo.createNode(elements)); }
public void clearBottomNode() { removeNode(hierarchyInfo.bottomEntity); bottomNode = hierarchyInfo.createNode(Collections.singleton(hierarchyInfo.bottomEntity)); addNode(bottomNode); }
public void clearTopNode() { removeNode(hierarchyInfo.topEntity); topNode = hierarchyInfo.createNode(Collections.singleton(hierarchyInfo.topEntity)); addNode(topNode); }