edu.uci.ics.jung.graph
Interface Forest<V,E>

All Superinterfaces:
DirectedGraph<V,E>, Graph<V,E>, Hypergraph<V,E>
All Known Subinterfaces:
Tree<V,E>
All Known Implementing Classes:
DelegateForest, DelegateTree, OrderedKAryTree

public interface Forest<V,E>
extends DirectedGraph<V,E>

An interface for a graph which consists of a collection of rooted directed acyclic graphs.

Author:
Joshua O'Madadhain

Method Summary
 int getChildCount(V vertex)
          Returns the number of children that vertex has in this tree.
 Collection<E> getChildEdges(V vertex)
          Returns the edges connecting vertex to its children in this tree.
 Collection<V> getChildren(V vertex)
          Returns the children of vertex in this tree.
 V getParent(V vertex)
          Returns the parent of vertex in this tree.
 E getParentEdge(V vertex)
          Returns the edge connecting vertex to its parent in this tree.
 Collection<Tree<V,E>> getTrees()
          Returns a view of this graph as a collection of Tree instances.
 
Methods inherited from interface edu.uci.ics.jung.graph.Graph
addEdge, addEdge, getDest, getEndpoints, getInEdges, getOpposite, getOutEdges, getPredecessorCount, getPredecessors, getSource, getSuccessorCount, getSuccessors, inDegree, isDest, isPredecessor, isSource, isSuccessor, outDegree
 
Methods inherited from interface edu.uci.ics.jung.graph.Hypergraph
addEdge, addEdge, addVertex, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getIncidentCount, getIncidentEdges, getIncidentVertices, getNeighborCount, getNeighbors, getVertexCount, getVertices, isIncident, isNeighbor, removeEdge, removeVertex
 

Method Detail

getTrees

Collection<Tree<V,E>> getTrees()
Returns a view of this graph as a collection of Tree instances.

Returns:
a view of this graph as a collection of Trees

getParent

V getParent(V vertex)
Returns the parent of vertex in this tree. (If vertex is the root, returns null.) The parent of a vertex is defined as being its predecessor in the (unique) shortest path from the root to this vertex. This is a convenience method which is equivalent to Graph.getPredecessors(vertex).iterator().next().

Returns:
the parent of vertex in this tree
See Also:
Graph.getPredecessors(Object), getParentEdge(Object)

getParentEdge

E getParentEdge(V vertex)
Returns the edge connecting vertex to its parent in this tree. (If vertex is the root, returns null.) The parent of a vertex is defined as being its predecessor in the (unique) shortest path from the root to this vertex. This is a convenience method which is equivalent to Graph.getInEdges(vertex).iterator().next(), and also to Graph.findEdge(vertex, getParent(vertex)).

Returns:
the edge connecting vertex to its parent, or null if vertex is the root
See Also:
Graph.getInEdges(Object), getParent(Object)

getChildren

Collection<V> getChildren(V vertex)
Returns the children of vertex in this tree. The children of a vertex are defined as being the successors of that vertex on the respective (unique) shortest paths from the root to those vertices. This is syntactic (maple) sugar for getSuccessors(vertex).

Parameters:
vertex - the vertex whose children are to be returned
Returns:
the Collection of children of vertex in this tree
See Also:
Graph.getSuccessors(Object), getChildEdges(Object)

getChildEdges

Collection<E> getChildEdges(V vertex)
Returns the edges connecting vertex to its children in this tree. The children of a vertex are defined as being the successors of that vertex on the respective (unique) shortest paths from the root to those vertices. This is syntactic (maple) sugar for getOutEdges(vertex).

Parameters:
vertex - the vertex whose child edges are to be returned
Returns:
the Collection of edges connecting vertex to its children in this tree
See Also:
Graph.getOutEdges(Object), getChildren(Object)

getChildCount

int getChildCount(V vertex)
Returns the number of children that vertex has in this tree. The children of a vertex are defined as being the successors of that vertex on the respective (unique) shortest paths from the root to those vertices. This is syntactic (maple) sugar for getSuccessorCount(vertex).

Parameters:
vertex - the vertex whose child edges are to be returned
Returns:
the Collection of edges connecting vertex to its children in this tree
See Also:
getChildEdges(Object), getChildren(Object), Graph.getSuccessorCount(Object)


Copyright © 2009. All Rights Reserved.