public class Branch
extends java.lang.Object
Constructor and Description |
---|
Branch(java.lang.String parent,
java.lang.String child)
Constructor for a branch of unknown length
|
Branch(java.lang.String parent,
java.lang.String child,
double length)
Constructor for a branch of known length
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getChild()
Get the child node of the branch
|
double |
getLength()
Get the length of the branch
|
java.lang.String |
getParent()
Gets the parent node of the branch
|
int |
hashCode() |
boolean |
hasLength()
Tests whether this branch has a length associated with it
|
java.lang.String |
toString() |
public Branch(java.lang.String parent, java.lang.String child)
parent
- The parent node, that is the node nearer the rootchild
- The child nodepublic Branch(java.lang.String parent, java.lang.String child, double length)
parent
- The parent node, that is the node nearer the rootchild
- The child nodelength
- The length of the branchpublic java.lang.String getParent()
public java.lang.String getChild()
public double getLength() throws TreeException
TreeException
- Thrown if the branch is of unknown lengthpublic boolean hasLength()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object