|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcommon.AbstractDGraph
common.DefaultDGraph
public class DefaultDGraph
Default implementation of the DGraph interface. Represents both the parent set and the child set for each node (even though this is redundant) so both kinds of sets can be accessed quickly.
| Field Summary |
|---|
| Fields inherited from interface common.DGraph |
|---|
EMPTY_GRAPH |
| Constructor Summary | |
|---|---|
DefaultDGraph()
Creates a new, empty graph. |
|
| Method Summary | |
|---|---|
void |
addEdge(java.lang.Object parent,
java.lang.Object child)
Throws an UnsupportedOperationException. |
boolean |
addNode(java.lang.Object v)
Throws an UnsupportedOperationException. |
java.lang.Object |
clone()
|
java.util.Set |
getChildren(java.lang.Object v)
Returns an unmodifiable set consisting of the given object's children, or null if the object is not in the graph. |
java.util.Set |
getParents(java.lang.Object v)
Returns an unmodifiable set consisting of the given object's parents, or null if the object is not in the graph. |
java.util.Set |
nodes()
Returns an unmodifiable set consisting of the nodes in this graph. |
void |
removeEdge(java.lang.Object parent,
java.lang.Object child)
Throws an UnsupportedOperationException. |
boolean |
removeNode(java.lang.Object v)
Throws an UnsupportedOperationException. |
void |
setParents(java.lang.Object v,
java.util.Set newParents)
Implements setParents in terms of addEdge and removeEdge. |
| Methods inherited from class common.AbstractDGraph |
|---|
getAncestors, getDescendants, getRoots, print |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDGraph()
| Method Detail |
|---|
public java.util.Set nodes()
nodes in interface DGraphpublic boolean addNode(java.lang.Object v)
AbstractDGraph
addNode in interface DGraphaddNode in class AbstractDGraphpublic boolean removeNode(java.lang.Object v)
AbstractDGraph
removeNode in interface DGraphremoveNode in class AbstractDGraph
public void addEdge(java.lang.Object parent,
java.lang.Object child)
AbstractDGraph
addEdge in interface DGraphaddEdge in class AbstractDGraph
public void removeEdge(java.lang.Object parent,
java.lang.Object child)
AbstractDGraph
removeEdge in interface DGraphremoveEdge in class AbstractDGraphpublic java.util.Set getParents(java.lang.Object v)
DGraph
getParents in interface DGraph
public void setParents(java.lang.Object v,
java.util.Set newParents)
AbstractDGraph
setParents in interface DGraphsetParents in class AbstractDGraphpublic java.util.Set getChildren(java.lang.Object v)
DGraph
getChildren in interface DGraphpublic java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||