/** * @see edu.uci.ics.jung.graph.Graph#getPredecessorCount(java.lang.Object) */ @Override public int getPredecessorCount(V vertex) { return delegate.getPredecessorCount(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getPredecessorCount(java.lang.Object) */ @Override public int getPredecessorCount(V vertex) { return delegate.getPredecessorCount(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getPredecessorCount(java.lang.Object) */ @Override public synchronized int getPredecessorCount(V vertex) { return delegate.getPredecessorCount(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getPredecessorCount(java.lang.Object) */ public int getPredecessorCount(V vertex) { return delegate.getPredecessorCount(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getPredecessorCount(java.lang.Object) */ public synchronized int getPredecessorCount(V vertex) { return delegate.getPredecessorCount(vertex); }
/** * @see edu.uci.ics.jung.graph.Graph#getPredecessorCount(java.lang.Object) */ public int getPredecessorCount(V vertex) { return delegate.getPredecessorCount(vertex); }
/** * Returns the number of vertices that have an outgoing edge to the given vertex. * @param vertex The vertex. * @return The predecessor count. */ public int getPredecessorCount(Object vertex) { return delegate.getPredecessorCount(vertex); }
public int getPredecessorCount(V vertex) { return graph.getPredecessorCount(vertex); } public Collection<V> getPredecessors(V vertex) {
/** * Returns the root of each tree of this forest as a {@code Collection}. */ public Collection<V> getRoots() { Collection<V> roots = new HashSet<V>(); for (V v : delegate.getVertices()) { if (delegate.getPredecessorCount(v) == 0) { roots.add(v); } } return roots; }
/** * @return the root of each tree of this forest as a {@code Collection}. */ public Collection<V> getRoots() { Collection<V> roots = new HashSet<V>(); for(V v : delegate.getVertices()) { if(delegate.getPredecessorCount(v) == 0) { roots.add(v); } } return roots; }
/** * @return the root of the tree, or null if the tree has > 1 roots */ public V getRoot() { V root = null; for (V v : delegate.getVertices()) { if (delegate.getPredecessorCount(v) == 0) { if (root == null) { root = v; } else { // we've found > 1 root, return null return null; } } } return root; }
/** * Returns list of nodes that are roots of trees in the graph. * * @param graph * ONDEXJUNGGraph * @return list of root nodes */ private Collection<ONDEXConcept> getRoots( Graph<ONDEXConcept, ONDEXRelation> g) { Set<ONDEXConcept> roots = new HashSet<ONDEXConcept>(); for (ONDEXConcept n : g.getVertices()) { // check selection of edge direction if (reversed && g.getSuccessorCount(n) == 0) { roots.add(n); } if (!reversed && g.getPredecessorCount(n) == 0) { roots.add(n); } } return roots; }
/** * A root is defined as having no ancestors. * * @param g * ONDEXJUNGGraph to get roots from * @return Collection<ONDEXConcept> containing all root nodes */ private Collection<ONDEXConcept> getRoots( Graph<ONDEXConcept, ONDEXRelation> g) { Set<ONDEXConcept> roots = new HashSet<ONDEXConcept>(); for (ONDEXConcept n : g.getVertices()) { // check selection of edge direction if (reversed && g.getSuccessorCount(n) == 0) { roots.add(n); } if (!reversed && g.getPredecessorCount(n) == 0) { roots.add(n); } } return roots; }