Class VBranch
java.lang.Object
DrawableNode
Branch
VBranch
public class VBranch
- extends Branch
Class that uses vertical spacing between
children with a gap between children as well
- Author:
- Mark Guzdial, Barb Ericson
Constructor Summary |
VBranch(int spacing)
Construct a branch with children and
next as null |
Method Summary |
void |
drawWith(Turtle turtle)
Ask all our children to draw,
then let the next node draw |
String |
toString()
Method to return a string with information
about this branch |
VBranch
public VBranch(int spacing)
- Construct a branch with children and
next as null
- Parameters:
spacing
- the gap to use
toString
public String toString()
- Method to return a string with information
about this branch
- Overrides:
toString
in class Branch
- Returns:
- the information string
drawWith
public void drawWith(Turtle turtle)
- Ask all our children to draw,
then let the next node draw
- Overrides:
drawWith
in class Branch
- Parameters:
turtle
- the Turtle to draw with