Class HBranch
java.lang.Object
DrawableNode
Branch
HBranch
public class HBranch
- extends Branch
Class that uses horizontal spacing between
children and a gap between them
- Author:
- Mark Guzdial, Barb Ericson
Constructor Summary |
HBranch(int spacing)
Construct a branch with first child and
next as null |
Method Summary |
void |
drawWith(Turtle turtle)
Ask all our children to draw,
then tell the next element to draw |
String |
toString()
Method to return a string with information
about this branch |
HBranch
public HBranch(int spacing)
- Construct a branch with first child and
next as null
- Parameters:
spacing
- the gap to leave between children
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 tell the next element to draw
- Overrides:
drawWith
in class Branch
- Parameters:
turtle
- Turtle to draw with