|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.epm.retriever.graph.AbstractGraph
wt.epm.retriever.ResultGraph
Represents a graph of Iterated objects, interconnected by various BinaryLink links. Allows fast traversing of the network, as well as building other high-performance graph algorithms. Immutable. Can be built using a set of Iterated objects and BinaryLink links. Node and/or Link inner classes can be overwritten, along with the corresponding newNode() and/or newLink() "creator" methods, to allow graph nodes and links to carry any additional information beyond an EPM object reference.
Nested Class Summary | |
protected class |
ResultGraph.GraphBuilder
Convenience inner class to eliminate some code reduplication while initializing the graph. |
static class |
ResultGraph.Link
Represents a link (edge) of the graph. |
static class |
ResultGraph.Node
Represents a node of the graph. |
protected class |
ResultGraph.NodeInfo
Auxiliary data structure for initialization. |
Nested classes inherited from class wt.epm.retriever.graph.AbstractGraph |
|
Field Summary | |
private static ResultGraph.Node[] |
EMPTY_NODES
|
private static Log |
log
|
protected Map |
oidLinkMap
|
protected Map |
oidNodeMap
|
Fields inherited from class wt.epm.retriever.graph.AbstractGraph |
has_cycles, is_forest, is_inverted, links, LNK_INVERT, LNK_JOINT, LNK_TREE, LNK_UNKNOWN, nodes, rootNodes |
Constructor Summary | |
ResultGraph()
Creates an un-populated graph object. |
|
ResultGraph(boolean isInverted)
Creates an un-populated graph object. |
Methods inherited from class wt.epm.retriever.graph.AbstractGraph |
analyseGraph, getGraphEdges, getGraphNodes, getLinkCount, getNodeCount, getRootGraphNodes, getTreeRootNode, hasCycles, isEmpty, isForest, isInverted, isTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static Log log
protected final Map oidNodeMap
protected final Map oidLinkMap
private static final ResultGraph.Node[] EMPTY_NODES
Constructor Detail |
public ResultGraph()
public ResultGraph(boolean isInverted)
isInverted
- link from roleB to RoleAMethod Detail |
public void populate(WTCollection objList, WTCollection linkList) throws WTException
populate
in interface PopulatableResult
objList
- Collection of Iterated or Mastered objects. May be empty, but not null.linkList
- Collection of BinaryLink objects. May be empty, but not null.
WTException
- - up to an implementation
NullPointerException
- if any one of the parameters is null.
ClassCastException
- if a node object is not Iterated (or Mastered),
or a link object is not a BinaryLink.
IllegalArgumentException
- if:
1) Not an Iterated/Mastered object found in the objList;
2) Not a BinaryLink found in the LinkList;
3) Linked object (role A or B) is not in the objList.
IllegalStateException
- if more than one Iterated found for
a particular master.protected ResultGraph.Node newNode(Persistable obj)
protected ResultGraph.Link newLink(BinaryLink bLink, ResultGraph.Node nodeA, ResultGraph.Node nodeB)
public final ResultGraph.Node[] getNodes()
public final ResultGraph.Link[] getLinks()
public final ResultGraph.Node[] getIncompleteNodes()
public final ResultGraph.Node[] getRootNodes()
public final ResultGraph.Node getTreeRoot()
public final ResultGraph.Node getNode(ObjectIdentifier oid)
public final ResultGraph.Node getNode(Iterated obj)
public final ResultGraph.Link getLink(ObjectIdentifier oid)
public final ResultGraph.Link getLink(BinaryLink lnk)
public final List getParents(ObjectIdentifier oid)
oid
- ObjectIdentifier
public final List getParents(Iterated obj)
obj
- Iterated
public final Iterated getParent(ObjectIdentifier oid)
oid
- ObjectIdentifier
public final Iterated getParent(Iterated obj)
obj
- Iterated
public final List getChildren(ObjectIdentifier oid)
oid
- ObjectIdentifier
public final List getChildren(Iterated obj)
obj
- Iterated
public final List getParentLinks(ObjectIdentifier oid)
oid
- ObjectIdentifier
public final List getParentLinks(Iterated obj)
obj
- Iterated
public final BinaryLink getParentLink(ObjectIdentifier oid)
oid
- ObjectIdentifier
public final BinaryLink getParentLink(Iterated obj)
obj
- Iterated
public final List getChildLinks(ObjectIdentifier oid)
oid
- ObjectIdentifier
public final List getChildLinks(Iterated obj)
obj
- Iterated
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |