Class HTower

Class HTower

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----HTower

public class HTower (View complete Source)
extends Panel

Constructor Index

 o HTower(int, int, int, int)
Constructor to be used if we are not passed an array of disk images .
 o HTower(int, int, int, int, Image, Image[])
Constructor which takes as its last two arguments an image for the base of the tower and an array of disk images, respectively.

Method Index

 o inXRange(int, int)
 o MaxNumberOfDisks()
 o NumberOfDisks()
 o paint(Graphics)
 o pop()
 o push(int)

Constructors

 o HTower
  public HTower(int screen_x,
                int screen_y,
                int maxD,
                int numD)
Constructor to be used if we are not passed an array of disk images . . . Instead, we just use integer disk weights.
 o HTower
  public HTower(int screen_x,
                int screen_y,
                int maxD,
                int numD,
                Image base,
                Image DiskImages[])
Constructor which takes as its last two arguments an image for the base of the tower and an array of disk images, respectively. (It is assumed that the index of each image in the array represents that disk's integer weight)

Methods

 o paint
  public void paint(Graphics g)
Overrides:
paint in class Component
 o NumberOfDisks
  public int NumberOfDisks()
 o MaxNumberOfDisks
  public int MaxNumberOfDisks()
 o inXRange
  public boolean inXRange(int some_x,
                          int dist)
 o push
  public boolean push(int diskWeight)
 o pop
  public int pop()