uchicago.src.sim.topology.graph
Class AbstractGraph
java.lang.Object
uchicago.src.sim.topology.graph.AbstractGraph
- All Implemented Interfaces:
- Graph, ModifyableTopology, RelationTopology, java.io.Serializable
- Direct Known Subclasses:
- DirectedGraph, UndirectedGraph
- public abstract class AbstractGraph
- extends java.lang.Object
- implements Graph, java.io.Serializable
- Version:
- $Revision: 1.7 $
- Author:
- Tom Howe
- See Also:
- Serialized Form
|
Field Summary |
protected java.lang.String |
type
|
|
Method Summary |
void |
addRelation(java.lang.Object element1,
java.lang.Object element2,
double distance)
Add a relationship in this Topology between the two elements with the given distance. |
boolean |
equals(java.lang.Object oth)
|
java.util.List |
getRelations(java.lang.Object element)
|
java.util.List |
getRelations(java.lang.Object element,
double range)
Gets all of the Objects within a given range. |
java.lang.String |
getRelationType()
Get the type of relationship/topology that is represented by this
Class. |
int |
hashCode()
|
void |
removeRelation(java.lang.Object element1,
java.lang.Object element2)
Remove the relationship between the two elements. |
void |
setRelationType(java.lang.String type)
Set the name for this type of relation. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uchicago.src.sim.topology.graph.Graph |
areAdjacent, degree, getAdjacentNodes, getAdjacentNodes, getEdges, getNodes, insertEdge, insertEdge, iterator, removeEdge, removeEdge, size |
type
protected java.lang.String type
AbstractGraph
public AbstractGraph()
getRelations
public java.util.List getRelations(java.lang.Object element,
double range)
- Gets all of the Objects within a given range.
- Specified by:
getRelations in interface RelationTopology
- Parameters:
element - range -
- Returns:
getRelations
public java.util.List getRelations(java.lang.Object element)
addRelation
public void addRelation(java.lang.Object element1,
java.lang.Object element2,
double distance)
- Add a relationship in this Topology between the two elements with the given distance.
- Specified by:
addRelation in interface ModifyableTopology
- Parameters:
element1 - element2 - distance -
removeRelation
public void removeRelation(java.lang.Object element1,
java.lang.Object element2)
- Remove the relationship between the two elements.
- Specified by:
removeRelation in interface ModifyableTopology
- Parameters:
element1 - element2 -
getRelationType
public java.lang.String getRelationType()
- Get the type of relationship/topology that is represented by this
Class. For example, if this represents a VonNeumann topology, this
should return the String "VON_NEUMANN".
- Specified by:
getRelationType in interface RelationTopology
- Returns:
setRelationType
public void setRelationType(java.lang.String type)
- Set the name for this type of relation.
- Specified by:
setRelationType in interface RelationTopology
- Parameters:
type -
hashCode
public int hashCode()
equals
public boolean equals(java.lang.Object oth)