|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.molwind.graph.DefaultEntityGraph
public class DefaultEntityGraph
DefaultEntityGraph implements an EntityGraph using the JUNG graph lib.
Constructor Summary | |
---|---|
DefaultEntityGraph()
Creates a new (empty) graph of entities. |
Method Summary | |
---|---|
void |
addEdge(java.lang.String vertexId1,
java.lang.String vertexId2,
Relationship relation,
int weight)
Adds a relationship edge between vertex vertexId1 and vertex vertexId2. |
void |
addEntity(java.lang.String vertexId,
WorldEntity entity)
Adds an entity i.e. |
void |
analyze(EntityGraphAnalyzer analyzer)
Analyzes the entity graph using the given analysis strategy. |
void |
devideLayers()
Devides the graph into Layers |
WorldEntity |
findEntity(java.lang.String vertexId)
Finds the given vertex id. |
edu.uci.ics.jung.graph.SparseGraph<EntityVertex,EntityEdge> |
getGraph()
Get the Graph value. |
EntityVertex[] |
getLayer(int layer)
Get all vertices for the given layer |
int |
getLayerCount()
Gives the count of Layers for the allocation levels |
java.util.Iterator |
iterator()
Returns an iterator over a set of elements. |
void |
setGraph(edu.uci.ics.jung.graph.SparseGraph newGraph)
Set the Graph value. |
java.lang.String |
toString()
Writes a graph ml representation of this graph |
void |
viewGraph(int size)
Visualizes the Graph |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultEntityGraph()
Method Detail |
---|
public edu.uci.ics.jung.graph.SparseGraph<EntityVertex,EntityEdge> getGraph()
public void setGraph(edu.uci.ics.jung.graph.SparseGraph newGraph)
newGraph
- The new Graph value.public void addEntity(java.lang.String vertexId, WorldEntity entity)
addEntity
in interface EntityGraph
vertexId
- the vertex identity
- the entity to addpublic WorldEntity findEntity(java.lang.String vertexId)
findEntity
in interface EntityGraph
vertexId
- the vertex id
public void addEdge(java.lang.String vertexId1, java.lang.String vertexId2, Relationship relation, int weight)
addEdge
in interface EntityGraph
vertexId1
- the first vertex idvertexId2
- the second vertex idrelation
- the relationship represented by the edgepublic void analyze(EntityGraphAnalyzer analyzer)
analyze
in interface EntityGraph
analyzer
- the analysis strategypublic int getLayerCount()
public EntityVertex[] getLayer(int layer)
the
- layer number
public void devideLayers()
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
public java.lang.String toString()
toString
in class java.lang.Object
public void viewGraph(int size)
the
- size of the Frame
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |