Package casa.lepton

Class OppEdgeFactory

java.lang.Object
casa.lepton.OppEdgeFactory
All Implemented Interfaces:
org.graphstream.graph.EdgeFactory<OppEdge>

public class OppEdgeFactory extends Object implements org.graphstream.graph.EdgeFactory<OppEdge>
Class used to dynamically create OppEdge instances. The newInstance(String, Node, Node, boolean) method is called by the Graph.addEdge(String, Node, Node) method. Setters (setConnectivityType(String), setStatus(String)) allow to set the edge properties for subsequent creations
  • Constructor Details

    • OppEdgeFactory

      public OppEdgeFactory(OppNetProperties props)
      Constructor.
      Parameters:
      props - the default edge properties
  • Method Details

    • newInstance

      public OppEdge newInstance(String id, org.graphstream.graph.Node src, org.graphstream.graph.Node dst, boolean directed)
      Create a OppEdge instance.
      Specified by:
      newInstance in interface org.graphstream.graph.EdgeFactory<OppEdge>
      Parameters:
      id - unique edge id.
      src - the source node.
      dst - the target node.
      directed - not used.
      Returns:
      the new edge
    • setConnectivityType

      public void setConnectivityType(String connectivityType)
      Set the connectivity type for the subsequent object creations.
      Parameters:
      connectivityType -
    • setStatus

      public void setStatus(String status)
      Set the edge status for the subsequent object creations.
      Parameters:
      status -
    • makeEdgeId

      public String makeEdgeId(org.graphstream.graph.Node src, org.graphstream.graph.Node dst, String connectivityType)
      Give a unique edge id from the given nodes ids and connectivityType in the form "id1-id2:type" where id1 strictly lower than id2.
      Parameters:
      src - a node.
      dst - other node.
      connectivityType - the connectivity type.
      Returns:
      unique edge id.
    • makeEdgeId

      public String makeEdgeId(String id1, String id2, String connectivityType)
      Give a unique edge id from the given nodes ids and connectivityType in the form "id1-id2:type" where id1 strictly lower than id2.
      Parameters:
      id1 - a node id.
      id2 - other node id.
      connectivityType - the connectivity type.
      Returns:
      unique edge id.