|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectuchicago.src.sim.topology.graph.AbstractGraph
uchicago.src.sim.topology.graph.UndirectedGraph
This class represents an undirected graph. As such each edge has a strength of 1, so distance is equivelent to number of links separating two objects. If you don't need directional edges, you should use this class as it has less overhead in terms of memory.
| Field Summary |
| Fields inherited from class uchicago.src.sim.topology.graph.AbstractGraph |
type |
| Constructor Summary | |
UndirectedGraph(java.util.Set s)
|
|
UndirectedGraph(java.util.Set con,
java.lang.String type)
Create a new DefaultGraph for a particular context with the given label. |
|
| Method Summary | |
boolean |
areAdjacent(java.lang.Object element1,
java.lang.Object element2)
Determine if the two objects are connected by an edge. |
boolean |
areAdjacent(java.lang.Object v,
java.lang.Object v1,
EdgeType type)
Returns whether the two elements share an edge with the given directionality. |
int |
degree()
|
int |
degree(java.lang.Object v,
EdgeType type)
Returns the number of edges for the object with the given directionality. |
double |
distance(java.lang.Object element1,
java.lang.Object element2)
Gets the distance between two objects in this topology. |
boolean |
equals(java.lang.Object o)
Two DefaultGraphs are equal if they have the same relationship table and the same type. |
java.util.List |
getAdjacentNodes(java.lang.Object v,
double distance,
EdgeType type)
|
java.util.List |
getAdjacentNodes(java.lang.Object v,
EdgeType type)
Get the Nodes that share an edge with the parameter with the proper directionality. |
Edge |
getEdge(java.lang.Object element1,
java.lang.Object element2)
|
java.util.List |
getEdges(java.lang.Object v,
EdgeType type)
Returns the edge objects of the given directionality for the object. |
protected java.util.Set |
getEdgeSet(java.lang.Object e)
|
java.util.Set |
getNodes()
|
int |
hashCode()
|
void |
insertEdge(Edge e)
Insert an edge that has already been created. |
void |
insertEdge(java.lang.Object e,
java.lang.Object e1)
Insert a new edge into the graph. |
void |
insertEdge(java.lang.Object e,
java.lang.Object e1,
double strength)
Insert a new edge into the graph. |
boolean |
isUndirected(Edge e)
Determine if a given edge is directed or undirected. |
java.util.Iterator |
iterator()
Get an iterator for the graph. |
void |
makeUndirected(Edge e)
This method is not implemented in DefaultGraph. |
void |
removeEdge(Edge e)
Removes an edge from the graph. |
void |
removeEdge(java.lang.Object e,
java.lang.Object e1)
Removes the edge between element1 and element2. |
boolean |
reverseDirection(Edge e)
Reverse the direction of the edge. |
void |
setDirectionFrom(Edge e,
java.lang.Object v)
This should force the directionality of an edge to be from the passed element. |
int |
size()
|
java.lang.String |
toString()
|
| Methods inherited from class uchicago.src.sim.topology.graph.AbstractGraph |
addRelation, getRelations, getRelations, getRelationType, removeRelation, setRelationType |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public UndirectedGraph(java.util.Set con,
java.lang.String type)
con - type - public UndirectedGraph(java.util.Set s)
| Method Detail |
public boolean areAdjacent(java.lang.Object element1,
java.lang.Object element2)
element1 - element2 -
public void insertEdge(java.lang.Object e,
java.lang.Object e1,
double strength)
e - The first element.e1 - The second element.strength - Ignored, as all edges are unweighted.
public void insertEdge(java.lang.Object e,
java.lang.Object e1)
e - The first element.e1 - The second element.protected java.util.Set getEdgeSet(java.lang.Object e)
public void insertEdge(Edge e)
e - public void removeEdge(Edge e)
e -
public void removeEdge(java.lang.Object e,
java.lang.Object e1)
e - e1 - public void makeUndirected(Edge e)
e -
java.lang.UnsupportedOperationExceptionpublic boolean isUndirected(Edge e)
e -
public boolean reverseDirection(Edge e)
e -
public void setDirectionFrom(Edge e,
java.lang.Object v)
e - v -
public java.util.List getAdjacentNodes(java.lang.Object v,
EdgeType type)
v - type -
public boolean areAdjacent(java.lang.Object v,
java.lang.Object v1,
EdgeType type)
v - v1 - type -
public java.util.List getEdges(java.lang.Object v,
EdgeType type)
v - type -
public Edge getEdge(java.lang.Object element1,
java.lang.Object element2)
public int degree(java.lang.Object v,
EdgeType type)
v - type -
public java.util.Iterator iterator()
public double distance(java.lang.Object element1,
java.lang.Object element2)
RelationTopology
element1 - element2 -
public int size()
public boolean equals(java.lang.Object o)
equals in class AbstractGrapho -
public int hashCode()
hashCode in class AbstractGraphpublic java.lang.String toString()
public int degree()
public java.util.List getAdjacentNodes(java.lang.Object v,
double distance,
EdgeType type)
v - distance - type -
public java.util.Set getNodes()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||