Class NodePair


  • public class NodePair
    extends Object
    A directed pair of nodes (a,b != b,a).
    Since:
    12463 (extracted from CombineWayAction)
    • Constructor Detail

      • NodePair

        public NodePair​(Node a,
                        Node b)
        Constructs a new NodePair.
        Parameters:
        a - The first node
        b - The second node
      • NodePair

        public NodePair​(Pair<Node,​Node> pair)
        Constructs a new NodePair.
        Parameters:
        pair - An existing Pair of nodes
    • Method Detail

      • getA

        public Node getA()
        Replies the first node.
        Returns:
        The first node
      • getB

        public Node getB()
        Replies the second node
        Returns:
        The second node
      • isSuccessorOf

        public boolean isSuccessorOf​(NodePair other)
        Determines if this pair is successor of another one (other.b == this.a)
        Parameters:
        other - other pair
        Returns:
        true if other.b == this.a
      • isPredecessorOf

        public boolean isPredecessorOf​(NodePair other)
        Determines if this pair is predecessor of another one (this.b == other.a)
        Parameters:
        other - other pair
        Returns:
        true if this.b == other.a
      • swap

        public NodePair swap()
        Returns the inversed pair.
        Returns:
        swapped copy
      • contains

        public boolean contains​(Node n)
        Determines if this pair contains the given node.
        Parameters:
        n - The node to look for
        Returns:
        true if n is in the pair, false otherwise