Class AbstractNode

java.lang.Object
org.biopax.paxtools.query.model.AbstractNode
All Implemented Interfaces:
GraphObject, Node
Direct Known Subclasses:
ControlWrapper, ControlWrapper, EventWrapper, EventWrapper, PhysicalEntityWrapper, PhysicalEntityWrapper

public abstract class AbstractNode extends Object implements Node
Author:
Ozgun Babur
  • Field Details

    • graph

      protected Graph graph
      Owner graph.
    • upstreamInited

      protected boolean upstreamInited
      Flag to remember if upstream links were created.
    • downstreamInited

      protected boolean downstreamInited
      Flag to remember if downstream links were created.
    • upperEquivalent

      protected Set<Node> upperEquivalent
      If there are equivalent nodes in the graph, and they have a hierarchy, like an homology node and members, then this set is for the parent equivalents of this node.
    • lowerEquivalent

      protected Set<Node> lowerEquivalent
      If there are equivalent nodes in the graph, and they have a hierarchy, like an homology node and members, then this set is for the child equivalents of this node.
    • upstream

      protected Set<Edge> upstream
      Set of upstream edges.
    • downstream

      protected Set<Edge> downstream
      Set of downstream edges.
    • pathSign

      protected int pathSign
      This variable can be used by algorithms that need to label nodes with a path sign (typically the current path).
    • banned

      protected Set<Node> banned
      For saying: "If the algorithm traverses this node, it cannot traverse those others". If this set will be used, then initBanned() should be called. Otherwise getBanned() will return an immutable empty set.
  • Constructor Details

    • AbstractNode

      protected AbstractNode(Graph graph)
      Constructor with the owner graph.
      Parameters:
      graph - Owner graph
  • Method Details

    • 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
    • getBanned

      public Set<Node> getBanned()
      Returns:
      Set of banned-to-traverse nodes if this node is traversed.
    • initBanned

      public void initBanned()
      Initializes the set of banned nodes. If the algorithm will use this set, then this method or setBanned method should be called.
    • setBanned

      public void setBanned(Set<Node> banned)
      Parameters:
      banned - Set of banned nodes
    • getUpstream

      public Collection<Edge> getUpstream()
      Gets the upstream edges. Initializes if necessary.
      Specified by:
      getUpstream in interface Node
      Returns:
      upstream edges
    • getDownstream

      public Collection<Edge> getDownstream()
      Gets the downstream edges. Initializes if necessary.
      Specified by:
      getDownstream in interface Node
      Returns:
      downstream edges
    • initUpstream

      public void initUpstream()
      Initializes the upstream connections.
    • initDownstream

      public void initDownstream()
      Initializes the downstream connections.
    • getUpstreamNoInit

      public Collection<Edge> getUpstreamNoInit()
      This class gets the upstream links but does not initialize.
      Returns:
      Upstream links
    • getDownstreamNoInit

      public Collection<Edge> getDownstreamNoInit()
      This class gets the downstream links but does not initialize.
      Returns:
      Downstream links
    • getUpperEquivalent

      public Collection<Node> getUpperEquivalent()
      Specified by:
      getUpperEquivalent in interface Node
      Returns:
      Parent equivalent nodes.
    • getLowerEquivalent

      public Collection<Node> getLowerEquivalent()
      Specified by:
      getLowerEquivalent in interface Node
      Returns:
      Child equivalent nodes
    • init

      public void init()
      Does nothing yet.
      Specified by:
      init in interface Node
    • getPathSign

      public int getPathSign()
      Returns:
      path sign
    • setPathSign

      public void setPathSign(int pathSign)
      Parameters:
      pathSign - The path sign
    • clear

      public void clear()
      Resets the path sign.
      Specified by:
      clear in interface GraphObject
    • isTranscription

      public boolean isTranscription()
      Nodes are not transcription by default.
      Specified by:
      isTranscription in interface Node
      Returns:
      False