All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class primitives.machines.SmallMachine

java.lang.Object
   |
   +----primitives.machines.Machine
           |
           +----primitives.machines.SmallMachine

public class SmallMachine
extends Machine
A class encapsulating the behavior of a Small machine used by SmallMachineProof applet.


Variable Index

 o alpha
the angle of the current state of the machine.
 o alphaRange
Specifies the angle limits of motion.
 o state
Switching state of the 2 joints.
 o t1
 o t2

Constructor Index

 o SmallMachine(Dimension)

Method Index

 o finalize()
Sets object field to null.
 o reachEnd()
streches the right leg.
 o redraw(Graphics)
Redraws the machine.
 o rotateJoint(double)
rotates the right joint with respect to the left joint.
 o switchBend()
Switches the bending state of the right joint.

Variables

 o state
 public int state[]
Switching state of the 2 joints. Only values of -1 and a are allowed [should be private]

 o alpha
 public double alpha
the angle of the current state of the machine. [should be private]

 o alphaRange
 public double alphaRange[]
Specifies the angle limits of motion.

 o t1
 private Coordinate t1
 o t2
 private Coordinate t2

Constructors

 o SmallMachine
 public SmallMachine(Dimension d)
Parameters:
d - the size of the rectangle to draw the machine in.

Methods

 o rotateJoint
 public void rotateJoint(double alpha) throws MachineException
rotates the right joint with respect to the left joint.

Parameters:
alpha - the angle to rotate the joint to.
Throws: MachineException
if the rotation requsted is not valid.
 o reachEnd
 public void reachEnd()
streches the right leg.

 o redraw
 public void redraw(Graphics g)
Redraws the machine.

Parameters:
g - the graphic context to draw to.
Overrides:
redraw in class Machine
 o switchBend
 public void switchBend()
Switches the bending state of the right joint.

See Also:
switchBend
 o finalize
 public void finalize() throws Throwable
Sets object field to null.

Throws: Throwable
.
Overrides:
finalize in class Machine

All Packages  Class Hierarchy  This Package  Previous  Next  Index