package shapes;

public class ShapeTester {
  public static void main(String[] args) {
    Shape s1 = new Circle("circle1", 5);
    System.out.println(s1);
    Shape s2 = new Rectangle("rectangle1", 7, 13);
    System.out.println(s2);
    Shape s3 = new Square("square1", 9);
    System.out.println(s3);
    System.out.println(s1.compareTo(s2));
    System.out.println(s2.compareTo(s3));
    System.out.println(s3.compareTo(s1));

    Shape[] myShapes = new Shape[5];
    myShapes[0] = new Circle("Circle", 3);
    myShapes[1] = new Rectangle("Rectangle", 3, 4);
    myShapes[2] = new Square("Square", 6);
    myShapes[3] = new Rectangle("Another Rectangle", 4, 5);
    myShapes[4] = new Circle("Circle", 5);
    for (int k = 0; k < myShapes.length; k++) {
      System.out.println(myShapes[k]);
    }
    System.out.println("Printing only the circles: ");
    for (int k = 0; k < myShapes.length; k++) {
      if (myShapes[k] instanceof Circle) {
        System.out.println(myShapes[k]);
      }
    }

  }
}
