|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.epm.retriever.graph.AbstractGraph
Represents a graph of objects (nodes) interconnected by various links (edges). Allows fast traversing of the network, as well as building other high-performance graph algorithms. GraphNode and/or GraphLink classes can be overwritten to allow graph nodes and links to carry any additional information.
Nested Class Summary | |
private class |
AbstractGraph.GraphAnalyzer
Auxiliary inner class to eliminate some code reduplication while initializing the graph. |
Field Summary | |
protected boolean |
has_cycles
Graph has cycles |
protected boolean |
is_forest
Graph is a tree or a set of trees |
protected boolean |
is_inverted
Graph built on "inverted" BinaryLinks |
protected GraphEdge[] |
links
Edges (links) of the graph |
static int |
LNK_INVERT
Inverted direction: creates a cycle in the graph |
static int |
LNK_JOINT
Joint link (between tree branches) |
static int |
LNK_TREE
Link belongs to spanning tree/forest |
static int |
LNK_UNKNOWN
Not initialized yet - probably an error in the initialization code |
private static Log |
log
|
protected GraphNode[] |
nodes
Nodes of the graph |
protected GraphNode[] |
rootNodes
Roots of the spanning forest |
Constructor Summary | |
AbstractGraph()
Creates a non-inverted graph. |
|
AbstractGraph(boolean isInverted)
Creates a graph with given direction of links. |
Method Summary | |
protected void |
analyseGraph()
Build the spanning tree (or forest) of this graph. |
GraphEdge[] |
getGraphEdges()
An array of all the GraphLink objects. |
GraphNode[] |
getGraphNodes()
An array of all the GraphNode objects. |
int |
getLinkCount()
Number of links (edges) in the graph. |
int |
getNodeCount()
Number of nodes in the graph. |
GraphNode[] |
getRootGraphNodes()
An array of nodes - roots of the spanning forest. |
GraphNode |
getTreeRootNode()
The top node of the tree. |
boolean |
hasCycles()
Graph is not a DAG (Directed Acyclic Graph). |
boolean |
isEmpty()
Shortcut for getNodeCount() == 0. |
boolean |
isForest()
Graph is a set of one or more trees. |
boolean |
isInverted()
Graph has been built for "inverted" order of BinaryLinks: traversing from "parents" to "children" will mean moving from role B toward role A. |
boolean |
isTree()
Graph is a tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Log log
public static final int LNK_UNKNOWN
public static final int LNK_TREE
public static final int LNK_JOINT
public static final int LNK_INVERT
protected GraphNode[] nodes
protected GraphEdge[] links
protected GraphNode[] rootNodes
protected boolean is_inverted
protected boolean is_forest
protected boolean has_cycles
Constructor Detail |
public AbstractGraph()
public AbstractGraph(boolean isInverted)
isInverted
- link from roleB to RoleAMethod Detail |
protected final void analyseGraph()
public final GraphNode[] getGraphNodes()
public final GraphEdge[] getGraphEdges()
public final GraphNode[] getRootGraphNodes()
public final GraphNode getTreeRootNode()
public final boolean isInverted()
public final boolean isEmpty()
public final int getNodeCount()
public final int getLinkCount()
public final boolean isTree()
public final boolean isForest()
public boolean hasCycles()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |