Class AbstractEdge

java.lang.Object
org.biopax.paxtools.query.model.AbstractEdge
All Implemented Interfaces:
Edge, GraphObject
Direct Known Subclasses:
EdgeL3, EdgeL3

public abstract class AbstractEdge extends Object implements Edge
The base class for an edge in the traversed graph.
Author:
Ozgun Babur
  • Constructor Details

    • AbstractEdge

      public AbstractEdge(Node source, Node target, Graph graph)
      Edges should know their source and target nodes, and their graph.
      Parameters:
      source - source node
      target - target node
      graph - graph
  • Method Details

    • getTargetNode

      public Node getTargetNode()
      Specified by:
      getTargetNode in interface Edge
      Returns:
      The target node
    • getSourceNode

      public Node getSourceNode()
      Specified by:
      getSourceNode in interface Edge
      Returns:
      The source node
    • getGraph

      public Graph getGraph()
      Description copied from interface: GraphObject
      Every graph object should have an owner graph.
      Specified by:
      getGraph in interface GraphObject
      Returns:
      The owner graph
    • getKey

      public String getKey()
      Description copied from interface: GraphObject
      This method is used for storing the object in a Map. The key should be uniquely generated for each edge in a graph.
      Specified by:
      getKey in interface GraphObject
      Returns:
      Key to use in a map
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getSign

      public int getSign()
      Edges are positive by default.
      Specified by:
      getSign in interface Edge
      Returns:
      1 indicating a positive edge
    • clear

      public void clear()
      Does nothing yet.
      Specified by:
      clear in interface GraphObject