Computer Science 132
Introduction To Computing II

Dickinson College
Spring Semester 2001
Grant Braught

/**
* Box3DTest.java -
*   Test the Box3D object.
*
* @author Grant William Braught
* @author Dickinson College
* @version 4/18/2001
*/
public class Box3DTest {

public static void main(String[] args) {

Box3D b1 = new Box3D(0,0,0,20,20,20);
Box3D b2 = new Box3D(1,2,3,5,6,7);
Box3D b3 = new Box3D(1,2,3,5,6,7);
Box3D b4 = new Box3D(1,2,3,5,6,7);

System.out.println(b1);
System.out.println(b2);
System.out.println(b3);

System.out.println();
System.out.println("volume: " + b1.getVolume());
System.out.println("X: " + b1.getX());
System.out.println("Y: " + b1.getY());
System.out.println("Z: " + b1.getZ());
System.out.println("Width: " + b1.getWidth());
System.out.println("Height: " + b1.getHeight());
System.out.println("Depth: " + b1.getDepth());

System.out.println();
System.out.println("b1 contains (2,2,2): " +
b1.contains(2,2,2));
System.out.println("b1 contains (-1,-2,-3): " +
b1.contains(-1,-2,-3));

b3.setLocation(2,3,4);
b3.setSize(6,7,8);
System.out.println();
System.out.println(b3);

System.out.println();
System.out.println("b1 contains b2: " +
b1.contains(b2));
System.out.println("b2 contains b1: " +
b2.contains(b1));

System.out.println();
System.out.println("b2 equals b3: " +
b2.equals(b3));
System.out.println("b2 equals b4: " +
b2.equals(b4));
}
}