Package casa.lepton

Class OppEdge

java.lang.Object
org.graphstream.graph.implementations.AbstractElement
org.graphstream.graph.implementations.AbstractEdge
casa.lepton.OppEdge
All Implemented Interfaces:
org.graphstream.graph.Edge, org.graphstream.graph.Element

public class OppEdge extends org.graphstream.graph.implementations.AbstractEdge
A Edge for a Graph representing a potential/real connection between two OppNode for a given connectivity type. The connection is characterized by the distance between the devices, that must be lower than the connectivity type's range.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.graphstream.graph.implementations.AbstractElement

    org.graphstream.graph.implementations.AbstractElement.AttributeChangeEvent
  • Field Summary

    Fields inherited from class org.graphstream.graph.implementations.AbstractEdge

    directed, graph, source, target

    Fields inherited from class org.graphstream.graph.implementations.AbstractElement

    attributes, attributesBeingRemoved, id
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    OppEdge(String id, OppNode source, OppNode target, String connectivityType, long range, String status, Set<String> hidden, String defaultConnectivityType, String defaultEdgeStatus, boolean directed)
    Constructs a new edge.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    attributeChanged(org.graphstream.graph.implementations.AbstractElement.AttributeChangeEvent event, String attribute, Object oldValue, Object newValue)
     
    Give the edge connectivity type.
    double
    Give the distance between the nodes computed by the previous updateDistance() invocation.
    Return the edge's status.
     
    void
    Attributes initializations.
    boolean
    Returns true if the two nodes are within mutual radio range for its connectivity type.
    boolean
     
    boolean
    setConnectivityType(String connectivityType)
    Update the edge connectivity type.
    boolean
    setStatus(String status)
    Update the connected status of the nodes.
    void
     
    toDGS(boolean withNodes)
    Gives a string representation of the edge to be printed to a DGS output.
    void
    Update the edge's distance from the nodes locations.

    Methods inherited from class org.graphstream.graph.implementations.AbstractEdge

    getNode0, getNode1, getOpposite, getSourceNode, getTargetNode, isDirected, isLoop, nullAttributesAreErrors, toString

    Methods inherited from class org.graphstream.graph.implementations.AbstractElement

    addAttribute, addAttributes, changeAttribute, clearAttributes, clearAttributesWithNoEvent, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getEachAttributeKey, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute, setIndex

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.graphstream.graph.Element

    addAttribute, addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getEachAttributeKey, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute
  • Constructor Details

    • OppEdge

      protected OppEdge(String id, OppNode source, OppNode target, String connectivityType, long range, String status, Set<String> hidden, String defaultConnectivityType, String defaultEdgeStatus, boolean directed)
      Constructs a new edge.
      Parameters:
      id - unique edge id.
      source - a node.
      target - other node.
      connectivityType - the connectivity type.
      range -
      status - the edges's initial status.
      hidden -
      defaultConnectivityType -
      defaultEdgeStatus -
  • Method Details

    • init

      public void init()
      Attributes initializations. Must be invoked after OppNetGraph.addEdge(String, Node, Node)
    • toDGS

      public String toDGS(boolean withNodes)
      Gives a string representation of the edge to be printed to a DGS output.
      Parameters:
      withNodes - if true, add the nodes ids after the edge id (for the edge creation)
      Returns:
      DGS sring representation of the edge
    • attributeChanged

      protected void attributeChanged(org.graphstream.graph.implementations.AbstractElement.AttributeChangeEvent event, String attribute, Object oldValue, Object newValue)
      Overrides:
      attributeChanged in class org.graphstream.graph.implementations.AbstractEdge
    • getDistance

      public double getDistance()
      Give the distance between the nodes computed by the previous updateDistance() invocation.
    • getConnectivityType

      public String getConnectivityType()
      Give the edge connectivity type.
    • getStatus

      public String getStatus()
      Return the edge's status.
    • updateDistance

      public void updateDistance()
      Update the edge's distance from the nodes locations.
    • isInRange

      public boolean isInRange()
      Returns true if the two nodes are within mutual radio range for its connectivity type.
    • setStatus

      public boolean setStatus(String status)
      Update the connected status of the nodes.
    • setConnectivityType

      public boolean setConnectivityType(String connectivityType)
      Update the edge connectivity type.
    • isTagged

      public boolean isTagged()
    • getTag

      public String getTag()
    • setTag

      public void setTag(String tag)