package seedu.address.model.task;

import java.util.Objects;

import seedu.address.commons.exceptions.IllegalValueException;

/**
 * Represents a Floating in the TaskTracker.
 * TODO FloatingTaskTest
 */

public class FloatingTask extends Task {

    private static final String FMT_STRING = "FloatingTask[name=%s, priority=%s]";

    private Priority priority;

    public FloatingTask(Name name, Priority priority) {
        super(name);
        assert priority != null;
        this.priority = priority;
    }

    public FloatingTask(String name, Priority priority) throws IllegalValueException {
        this(new Name(name), priority);
    }

    public FloatingTask(String name) throws IllegalValueException {
        this(new Name(name), new Priority("0"));
    }

    public Priority getPriority() {
        return this.priority;
    }

    @Override
    public boolean equals(Object other) {
        return other == this
            || (other instanceof FloatingTask
            && name.equals(((FloatingTask)other).name)
            && priority.equals(((FloatingTask)other).priority));
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, priority);
    }

    @Override
    public String toString() {
        return String.format(FMT_STRING, name, priority);
    }
}

@@ -319,16 +319,29 @@
 ority=%25s
+, finished=%25s
 %5D%22;%0A%0A   
@@ -369,16 +369,53 @@
 ority;%0A%0A
+    private final boolean finished;%0A%0A
     publ
@@ -458,16 +458,34 @@
 priority
+, boolean finished
 ) %7B%0A    
@@ -560,32 +560,166 @@
 ity = priority;%0A
+        this.finished = finished;%0A    %7D%0A%0A    public FloatingTask(Name name, Priority priority) %7B%0A        this(name, priority, false);%0A
     %7D%0A%0A    publi
@@ -825,32 +825,39 @@
 (name), priority
+, false
 );%0A    %7D%0A%0A    pu
@@ -964,16 +964,23 @@
 ity(%220%22)
+, false
 );%0A    %7D
@@ -1046,32 +1046,103 @@
 riority;%0A    %7D%0A%0A
+    public boolean isFinished() %7B%0A        return this.finished;%0A    %7D%0A%0A
     @Override%0A  
@@ -1373,16 +1373,74 @@
 riority)
+%0A            && finished == ((FloatingTask)other).finished
 );%0A    %7D
@@ -1627,27 +1627,37 @@
 , name, priority
+, finished
 );%0A    %7D%0A%7D%0A

add "finished" attribute to FloatingTask class