biTree
Interface WeightCompare
- All Known Implementing Classes:
- BiTree, Symbol
- public interface WeightCompare
This interface exists so I can sort a vector with both BiTrees and
Symbols in it. These classes both impelement this interface.
This is also what holds the tree together, since everything on a
tree is of type WeightCompare.
- Author:
- Chad Cook
Method Summary |
int |
compareTo(java.lang.Object wc)
The required compareTo method from Comparable. |
void |
execute(Visitor v)
The hook method for visitors |
java.lang.Integer |
getWeight()
The getter method for the weight |
getWeight
public java.lang.Integer getWeight()
- The getter method for the weight
- Returns:
- The weight of this WeightCompare
compareTo
public int compareTo(java.lang.Object wc)
- The required compareTo method from Comparable. I put this
here just as an extra reminder; all of the WeightCompare classes
implement Comparable.
- Parameters:
Object
- The object to compare- Returns:
- The result of comparing this object and wc
execute
public void execute(Visitor v)
- The hook method for visitors
- Parameters:
Visitor
- The visitor