/*
 * Copyright (c) 2004-2017, by Alex Leigh.
 * All rights reserved.
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE
 * The copyright notice above does not evidence any
 * actual or intended publication of such source code.
 */

package lc.mecha.geom;

/**
 * POJO class which contains an angle in degrees.
 *
 * @author Alex Leigh
 */
public class Angle {
    public final double degrees;

    public Angle(double degrees) {
        this.degrees = degrees;
    }

    public double getDegrees() {
        return degrees;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Angle angle = (Angle) o;

        return Double.compare(angle.degrees, degrees) == 0;

    }

    @Override
    public int hashCode() {
        long temp = Double.doubleToLongBits(degrees);
        return (int) (temp ^ (temp >>> 32));
    }

    @Override
    public String toString() {
        return "Angle{" +
                "degrees=" + degrees +
                '}';
    }
}
