Balance Problem Set Javadocs

balance
Interface End


public interface End

This is the interface to observe and manipulate one end of a line. It lets you getSlope() and moveEnd(int).

Copyright (c) 1998 Massachusetts Institute of Technology

Version:
$Id: End.java,v 1.1.1.1 2002/06/05 21:56:33 root Exp $
Author:
Todd C. Parnell, tparnell@ai.mit.edu

Method Summary
 float getSlope()
          getSlope() returns a float representing the slope of the line as seen from our point of view; a positive slope means we're at the lower end of the line.
 int moveEnd(int distance)
          moveEnd takes an int representing how far to move the end.
 

Method Detail

getSlope

public float getSlope()
getSlope() returns a float representing the slope of the line as seen from our point of view; a positive slope means we're at the lower end of the line.


moveEnd

public int moveEnd(int distance)
moveEnd takes an int representing how far to move the end. A positive argument raises our end of the line. moveEnd should be called even when we don't actually want to move: give it an argument of 0. (It also handles some bookkeeping....) moveEnd returns an int corresponding to the actual distance moved which may differ from its argument. This could happen if a boundary condition has been reached or if the weight affects the mowement.


Balance Problem Set Javadocs