Class GraphDefinition<T>

java.lang.Object
cz.metacentrum.perun.utils.graphs.generators.GraphDefinition<T>

public class GraphDefinition<T> extends Object
Class that defines relations in graph.

New relations can be added with method 'addEntitiesData' where the expected format is a Map of GraphDefinition entities where every entity has a Set of target entities. In other words, there is an oriented Edge between enetity and its target entities. After specifying entities data, you have to set edge type with method 'withEdgeType'.

Example: graphDefinition.addEntitiesData(data).withEdgeType(GraphEdge.Type.BOLD);

New relations can also be added with method 'addEntity'. After specifying the entity, you have to set target entities with method 'withTargetEntities'. After that you must set the graph edge type.

Example: graphDefinition.addEntity(entity).withTargetEntities(targetEntities).withEdgeType(GraphEdge.Type.BOLD);

Author:
Vojtech Sassmann <vojtech.sassmann@gmail.com>
  • Constructor Details

    • GraphDefinition

      public GraphDefinition()
  • Method Details

    • addEntitiesData

      public GraphDefinition<T>.AddEntitiesData addEntitiesData(Map<T,Set<T>> entityWithTargetEntities)
      Method used to add entities data to definition. After calling this method you have to set the Graph edge type.
      Parameters:
      entityWithTargetEntities - entities data
      Returns:
      object defining that entities data has been set
    • addEntity

      public GraphDefinition<T>.AddEntity addEntity(T entity)
      Method used to add entity to definition. After calling this method you have to set the target entities.
      Parameters:
      entity - entity
      Returns:
      object defining that entity data has been set