|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.graph.util.graph.GraphFuser
Removes all nodes of degree 2 from a graph. The following are examples
of graphs being fused.
When a node of degree 2 is removed from tan unfused graph, the two edges
is is adjacent to must be merged into a single edge. More generally if n
adjacent nodes of degree 2 are removed, n+1 edges must be merged into a
single edge. This change in graph structure has an effect on the entities
modelled by the graph. Since each edge models a single object, replacing
multiple edges with a single edge results in an inconsistet model. Therefore
an EdgeMerger is used to merge the objects represented by the multiple edges
into a single object. This new object becomes the underlying object of the
merged edge.
Nested Class Summary | |
static interface |
GraphFuser.EdgeMerger
Merges the underlying objects represented by a number of edges into a single object. |
Constructor Summary | |
GraphFuser(Graph graph,
GraphBuilder builder,
GraphFuser.EdgeMerger merger)
Constructs a GraphFuser. |
Method Summary | |
boolean |
fuse()
Performs the fuse. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphFuser(Graph graph, GraphBuilder builder, GraphFuser.EdgeMerger merger)
graph
- Graph to fuse.merger
- Used to merge edges.Method Detail |
public boolean fuse()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |