|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--GraphNode
GraphNode is used to model the node in a graph. It holds handles to the course object (with its own prerequisite set) and a children set. The children set contains all those course ID's that this node would point to in a graph. It also holds the integer inDegrees.
| Constructor Summary | |
GraphNode(Course c)
Create a GraphNode with a Course object. |
|
| Method Summary | |
void |
addChild(java.lang.String courseID)
add a child to this GraphNode -- this graph node will have this child on its adjaceny list. |
void |
decDegrees()
subtract one from the inDegrees field |
java.util.Iterator |
getChildren()
return an iterator on the cildren (adjacency list) |
Course |
getCourse()
|
void |
incDegrees()
add one to the inDegrees field |
boolean |
inDegreeZero()
Is the inDegree field zero? |
boolean |
isRemoved()
check if node is considered in the graph |
void |
remove()
set inDegrees field to -1 to signal node no longer considered in the graph |
void |
setIndegreesZero()
Force inDegree to 0 |
java.lang.String |
toString()
convert the GraphNode to a String |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public GraphNode(Course c)
c - the course to add to the graph| Method Detail |
public Course getCourse()
public void incDegrees()
public void decDegrees()
public void remove()
public void setIndegreesZero()
public boolean inDegreeZero()
public boolean isRemoved()
public void addChild(java.lang.String courseID)
public java.util.Iterator getChildren()
public java.lang.String toString()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||