Interface Connection
-
public interface ConnectionThe Interface Connection representing a connection of nodes in trees.- Author:
- Martin Scharm
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddWeight(double s)Adds (+) a weight to the connection's weight.TreeNodegetPartnerOf(TreeNode node)Gets the opposite of the given node in this connection.TreeNodegetTreeA()Gets the corresponding node in tree a.TreeNodegetTreeB()Gets the corresponding node in tree b.doublegetWeight()Gets the weight of that connection.voidscaleWeight(double s)Scales the weight with an factor s.voidsetWeight(double w)Sets the weight of that connection.
-
-
-
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, andgetPartnerOf (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
-
-