/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package FanManager.model;

import java.io.Serializable;

public class Fan implements Serializable {

    /**
     * For serialization/deserialization to check class version.
     */
    private static final long serialVersionUID = -7621164129293024859L;

    private boolean isOn;
    private double power;

    private double duty;
    private double speed;

    private double minStartingTemp;
    private double minRunningTemp;

    private double minSpeed;
    private double maxSpeed;

    private double temperature;

	// Constructor
    //
    public Fan() {
        this(0.0, 0.0, 0.0, 70, 60, 0.0, 100.0, 70.0);
    }

    public Fan(double power, double duty, double speed,
            double minStartingTemp, double minRunningTemp,
            double minSpeed, double maxSpeed, double temperature) {
        super();

        this.power = power;
        this.duty = duty;
        this.minStartingTemp = minStartingTemp;
        this.minRunningTemp = minRunningTemp;
        this.minSpeed = minSpeed;
        this.maxSpeed = maxSpeed;
        this.temperature = temperature;

        setSpeed(speed);
    }

	// Turn Off
    //
    public void turnOff() {
        isOn = false;

        this.power = 0;
        this.duty = 0;
        setSpeed(0);
    }

	// Turn On
    //
    public void turnOn(double power, double duty, double speed) {
        isOn = true;

        this.power = power;
        this.duty = duty;
        setSpeed(speed);
    }

    public void turnOn(double power, double duty) {
        isOn = true;

        this.power = power;
        this.duty = duty;
        setSpeed(minSpeed);
    }

	// Getters & Setters
    //
    //  Is On?
    public boolean isOn() {
        return isOn;
    }

    // Power
    public double getPower() {
        return power;
    }

    public void setPower(double power) {
        this.power = power;
    }

    // Duty
    public double getDuty() {
        return duty;
    }

    public void setDuty(double duty) {
        this.duty = duty;
    }

    // Speed
    public double getSpeed() {
        return speed;
    }

    public void setSpeed(double speed) {
        if (isOn && this.speed + speed > this.maxSpeed) {
            this.speed = this.maxSpeed;
        } else if (isOn && this.speed + speed < this.minSpeed) {
            this.speed = this.minSpeed;
        } else {
            this.speed = speed;
        }
    }

    // Temperature
    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }

    // Minimum Starting Temperature
    public double getMinStartingTemp() {
        return minStartingTemp;
    }

    public void setMinStartingTemp(double minStartingTemp) {
        this.minStartingTemp = minStartingTemp;
    }

    // Minimum Running Temperature
    public double getMinRunningTemp() {
        return minRunningTemp;
    }

    public void setMinRunningTemp(double minRunningTemp) {
        this.minRunningTemp = minRunningTemp;
    }

    // Minimum Speed
    public double getMinSpeed() {
        return minSpeed;
    }

    public void setMinSpeed(double minSpeed) {
        this.minSpeed = minSpeed;
    }

    // Maximum Speed
    public double getMaxSpeed() {
        return maxSpeed;
    }

    public void setMaxSpeed(double maxSpeed) {
        this.maxSpeed = maxSpeed;
    }

}

@@ -732,17 +732,20 @@
 ure;%0D%0A%0D%0A
-%09
+    
 // Const
@@ -834,32 +834,404 @@
 , 70.0);%0D%0A    %7D%0D
+%0A    %0D%0A    public Fan(double speed, Fan f)%7B%0D%0A        this.power = f.power;%0D%0A        this.duty = f.duty;%0D%0A        this.minStartingTemp = f.minStartingTemp;%0D%0A        this.minRunningTemp = f.minRunningTemp;%0D%0A        this.minSpeed = f.minSpeed;%0D%0A        this.maxSpeed = f.maxSpeed;%0D%0A        this.temperature = f.temperature;%0D%0A        %0D%0A        setSpeed(speed);        %0D%0A    %7D%0D
 %0A%0D%0A    public Fa
@@ -1715,33 +1715,36 @@
 eed);%0D%0A    %7D%0D%0A%0D%0A
-%09
+    
 // Turn Off%0D%0A   
@@ -1882,17 +1882,20 @@
    %7D%0D%0A%0D%0A
-%09
+    
 // Turn 
@@ -2263,9 +2263,12 @@
 %0D%0A%0D%0A
-%09
+    
 // G
@@ -4067,32 +4067,32 @@
 le maxSpeed) %7B%0D%0A
-
         this.max
@@ -4119,11 +4119,722 @@
    %7D%0D%0A%0D%0A
+    @Override%0D%0A    public boolean equals(Object obj) %7B%0D%0A        if (obj instanceof Fan) %7B%0D%0A            Fan temp = (Fan) obj;%0D%0A            if (this.isOn == temp.isOn%0D%0A                    && this.power == temp.power%0D%0A                    && this.duty == temp.duty%0D%0A                    && this.speed == temp.speed%0D%0A                    && this.minStartingTemp == temp.minStartingTemp%0D%0A                    && this.minRunningTemp == temp.minRunningTemp%0D%0A                    && this.minSpeed == temp.minSpeed%0D%0A                    && this.maxSpeed == temp.maxSpeed%0D%0A                    && this.temperature == temp.temperature) %7B%0D%0A                return true;%0D%0A            %7D%0D%0A        %7D%0D%0A%0D%0A        return false;%0D%0A    %7D%0D%0A%0D%0A
 %7D%0D%0A

Add new Fan constructor using speed and second Fan object; Add equals method