|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTrees.Branch
public class Branch
Represents a branch in a tree
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 branchMethod Detail |
---|
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |