|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DirectedGraph
DirectedGraph
is an extension of the
Graph
interface that tracks the direction of the edges
that have been added to the graph. This results in a stregthening
of the specification for several of Graph
's methods
and the addition of two new methods, childrenOf(node)
and parentsOf(node)
.
Method Summary | |
---|---|
boolean |
addEdge(Object f,
Object t)
Ensures that this graph contains an edge from f to t . |
Collection |
childrenOf(Object node)
Returns a collection view for the children of a specific node. |
Collection |
edges()
Returns a collection view of the edges contained in this graph. |
Collection |
edgesFor(Object node)
Returns a collection view of the edges joining node to nodes in the graph. |
Collection |
parentsOf(Object node)
Returns a collection view for the parents of a specific node. |
Methods inherited from interface harpoon.Analysis.GraphColoring.Graph |
---|
addNode, getDegree, neighborsOf, nodeSet |
Method Detail |
---|
boolean addEdge(Object f, Object t)
f
to t
.
this
.
f
to t
will be in
this
. Returns true if
this
changed as a result of the call.
addEdge
in interface Graph
IllegalArgumentException
- f
or
t
is not present in the node set for
this
.
UnsupportedOperationException
- addEdge is not supported
by this graph.Collection childrenOf(Object node)
Collection
view
of nodes that have an edge from node
to
them.
node
is not removed from
this
while the returned
Collection
is in use.
IllegalArgumentException
- If node
is not
present in the node set for this
.Collection parentsOf(Object node)
Collection
view
of nodes that have an edge from them to
node
.
node
is not removed from
this
while the returned
Collection
is in use.
IllegalArgumentException
- If node
is not
present in the node set for this
.Collection edges()
Collection
of
two-element List
s (known as pairs)
where each pair corresponds to an edge { n1, n2 } in
this. If the graph is modified while an iteration over
the collection is in progress, the results of the
iteration are undefined. Order may or may not be
significant in the pairs returned.
edges
in interface Graph
Collection edgesFor(Object node)
node
to nodes in the graph.
Collection
of
two-element List
s (known as
pairs) where each pair corresponds to an edge
[ node, n ] or [ n, node ] in this. If the graph is
modified while an iteration over the collection is in
progress, the results of the iteration are undefined.
edgesFor
in interface Graph
IllegalArgumentException
- If node
is not
present in the node set for this
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |