|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectbaseCode.common.Visitable
baseCode.dataStructure.graph.AbstractGraphNode
baseCode.dataStructure.graph.DirectedGraphNode
A graph node that has the concept of parents and children. Keys can be anything, but probably Strings or Integers.
Copyright (c) Columbia University
| Field Summary | |
protected java.util.Set |
children
|
protected java.util.Set |
parents
|
protected int |
topoSortOrder
|
| Fields inherited from class baseCode.dataStructure.graph.AbstractGraphNode |
graph, item, key, log, visited |
| Constructor Summary | |
DirectedGraphNode(java.lang.Object key,
java.lang.Object value,
Graph graph)
|
|
| Method Summary | |
void |
addChild(java.lang.Object newChildKey)
|
void |
addParent(java.lang.Object newParentKey)
|
java.lang.Object |
clone()
Makes a copy of this node. |
int |
compareTo(java.lang.Object o)
Uses the topological sort order. |
java.util.Set |
getAllChildNodes()
Get all the children of this node, recursively. |
java.util.Set |
getAllParentNodes()
Get all the parents of this node, recursively. |
Graph |
getChildGraph()
Get the subgraph starting from this node, including this node. |
java.lang.Object |
getChildKeys()
|
java.util.Set |
getChildNodes()
Get the immediate children of this node. |
java.lang.Object |
getParentKeys()
|
java.util.Set |
getParentNodes()
Get the immediate parents of this node. |
int |
getTopoSortOrder()
|
boolean |
hasChild(java.lang.Object j)
Check to see if this node has a particular immediate child. |
boolean |
hasParent(java.lang.Object j)
Check to see if this node has a particular immediate parent. |
int |
inDegree()
|
boolean |
isLeaf()
|
int |
numChildren()
|
int |
numParents()
|
int |
outDegree()
|
void |
prune()
Remove connections that are to nodes not contained in this graph |
void |
setTopoSortOrder(int i)
|
java.lang.String |
toString()
|
| Methods inherited from class baseCode.dataStructure.graph.AbstractGraphNode |
getGraph, getItem, getKey, isVisited, mark, setGraph, setItem, setValue, unMark |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Set parents
protected java.util.Set children
protected int topoSortOrder
| Constructor Detail |
public DirectedGraphNode(java.lang.Object key,
java.lang.Object value,
Graph graph)
key - Objectvalue - Objectgraph - Graph| Method Detail |
public void setTopoSortOrder(int i)
i - intpublic int getTopoSortOrder()
public void addChild(java.lang.Object newChildKey)
newChildKey - Objectpublic void addParent(java.lang.Object newParentKey)
newParentKey - Objectpublic java.lang.Object getParentKeys()
public java.lang.Object getChildKeys()
public java.util.Set getChildNodes()
public java.util.Set getParentNodes()
public Graph getChildGraph()
public boolean isLeaf()
public int outDegree()
public int inDegree()
public int numChildren()
public int numParents()
public java.util.Set getAllChildNodes()
public java.util.Set getAllParentNodes()
public boolean hasChild(java.lang.Object j)
j - Object
public boolean hasParent(java.lang.Object j)
j - Object
public java.lang.String toString()
toString in class AbstractGraphNodepublic void prune()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - Object
public java.lang.Object clone()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||