Class HBranch

java.lang.Object
  extended by DrawableNode
      extended by Branch
          extended by 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
 
Methods inherited from class Branch
addChild, getFirstChild
 
Methods inherited from class DrawableNode
add, drawOn, getNext, insertAfter, last, remove, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HBranch

public HBranch(int spacing)
Construct a branch with first child and next as null

Parameters:
spacing - the gap to leave between children
Method Detail

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