Interface Connection


  • public interface Connection
    The Interface Connection representing a connection of nodes in trees.
    Author:
    Martin Scharm
    • Method Detail

      • getPartnerOf

        TreeNode getPartnerOf​(TreeNode node)
        Gets the opposite of the given node in this connection. Thus, if this connection connects A and B: getPartnerOf (A) = B, and getPartnerOf (B) = A.
        Parameters:
        node - the node
        Returns:
        the partner of
      • getTreeA

        TreeNode getTreeA()
        Gets the corresponding node in tree a.
        Returns:
        the node in tree a
      • getTreeB

        TreeNode getTreeB()
        Gets the corresponding node in tree b.
        Returns:
        the node in tree b
      • setWeight

        void setWeight​(double w)
        Sets the weight of that connection. Thus, connections can be weighted differently.
        Parameters:
        w - the new weight
      • getWeight

        double getWeight()
        Gets the weight of that connection.
        Returns:
        the weight
      • scaleWeight

        void scaleWeight​(double s)
        Scales the weight with an factor s.
        Parameters:
        s - the factor used to scale the weight
      • addWeight

        void addWeight​(double s)
        Adds (+) a weight to the connection's weight.
        Parameters:
        s - the s