org.molwind.graph
Interface EntityGraph

All Superinterfaces:
java.lang.Iterable
All Known Implementing Classes:
DefaultEntityGraph

public interface EntityGraph
extends java.lang.Iterable

EntityGraph stores graphs of entities (= vertices) and relationships (= edges) among those.

Version:
1.0
Author:
Oliver Karch

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.
 WorldEntity findEntity(java.lang.String vertexId)
          Finds the given vertex id.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addEntity

void addEntity(java.lang.String vertexId,
               WorldEntity entity)
Adds an entity i.e. vertex to graph. If the vertex id is existing already the vertex is replaced.

Parameters:
vertexId - the vertex id
entity - the entity to add

findEntity

WorldEntity findEntity(java.lang.String vertexId)
Finds the given vertex id.

Parameters:
vertexId - the vertex id
Returns:
the entity if it was found, null otherwise

addEdge

void addEdge(java.lang.String vertexId1,
             java.lang.String vertexId2,
             Relationship relation,
             int weight)
Adds a relationship edge between vertex vertexId1 and vertex vertexId2. For any non-existing vertex a new vertex is created.

Parameters:
vertexId1 - the first vertex id
vertexId2 - the second vertex id
relation - the relationship represented by the edge

analyze

void analyze(EntityGraphAnalyzer analyzer)
Analyzes the entity graph using the given analysis strategy.

Parameters:
analyzer - the analysis strategy


Copyright © 2008-2010. All Rights Reserved.