@Override public IVisualizableNode[] getParents() { List<IVisualizableNode> parentList = new ArrayList<IVisualizableNode>(); for (ISimpleNode parent : content.getParents()) { parentList.add(getContentNodeMap().get(parent)); } return parentList.toArray(new IVisualizableNode[parentList.size()]); }
@Override public IVisualizableNode[] getParents() { Set<IVisualizableNode> parents = new LinkedHashSet<IVisualizableNode>(); for (ISimpleNode node : contentNodes) { for (ISimpleNode parent : node.getParents()) { parents.add(getContentNodeMap().get(parent)); } } return parents.toArray(new IVisualizableNode[parents.size()]); }
private boolean isTree() { if (getNodesByLayer(1).length != 1) { return false; } for (int layerIndex = 2; layerIndex <= deepestLayer; layerIndex++) { for (ISimpleNode node : getNodesByLayer(layerIndex)) { if (node.getParents().length != 1) { return false; } } } return true; }