/home/caleb/ASDV-Java/Semester 2/Assignments/MP5_CalebFontenot/src/main/java/com/calebfontenot/mp5_calebfontenot/Circle.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.calebfontenot.mp5_calebfontenot;

/**
 *
 * @author caleb
 */
public class Circle extends GeometricObject {
    private double diameter;

    public Circle(double diameter) {
        this.diameter = diameter;
        System.out.println("Circle Diameter: " + diameter);
    }
    
    @Override
    public double getArea() {
        double radius = diameter / 2;
        return Math.PI * Math.pow(radius, 2);
    }
    
    @Override
    public double getPerimeter() {
        return Math.PI * diameter;
    }

    @Override
    public String toString() {
        return "Circle{" + "diameter=" + diameter + '}';
    }
    
    @Override
    public int compareTo(Object t) {
        System.out.println(this.getArea() + ", " + ((Circle) t).getArea());
        if (this.getArea() < ((Circle) t).getArea()) {
            return -1;
        } else if (this.getArea() > ((Circle) t).getArea()) {
            return 1;
        } else {
            return 0;
        }
    }
// The compiler made me implement this, not sure why
    @Override
    public int compareTo() {
        throw new UnsupportedOperationException("No compare object supplied!");
    }
  
}