forked from nusCS2113-AY1920S1/PersonalAssistant-Duke
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy up packages (nusCS2113-AY1920S1#32)
This closes nusCS2113-AY1920S1#29.
- Loading branch information
Showing
30 changed files
with
243 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
...java/duke/command/AddDeadlineCommand.java → ...ss/logic/commands/AddDeadlineCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...in/java/duke/command/AddEventCommand.java → ...chess/logic/commands/AddEventCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
...ain/java/duke/command/AddTodoCommand.java → ...uchess/logic/commands/AddTodoCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/main/java/duke/command/ByeCommand.java → ...va/duchess/logic/commands/ByeCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/main/java/duke/command/Command.java → .../java/duchess/logic/commands/Command.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
...main/java/duke/command/DeleteCommand.java → ...duchess/logic/commands/DeleteCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
src/main/java/duke/command/DoneCommand.java → ...a/duchess/logic/commands/DoneCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
src/main/java/duke/command/FindCommand.java → ...a/duchess/logic/commands/FindCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/main/java/duke/command/ListCommand.java → ...a/duchess/logic/commands/ListCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 57 additions & 55 deletions
112
...in/java/duke/command/ReminderCommand.java → ...chess/logic/commands/ReminderCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,58 @@ | ||
package duke.command; | ||
|
||
import duke.dukeexception.DukeException; | ||
import duke.task.Deadline; | ||
import duke.task.Task; | ||
import duke.task.TaskList; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Searches Tasklist and filters out deadline objects. | ||
*/ | ||
public class ReminderCommand extends Command { | ||
|
||
/** | ||
* Displays Deadline objects to user. | ||
* | ||
* @param taskList List containing tasks | ||
* @param ui Userinterface object | ||
* @param storage Storage object | ||
* @throws DukeException Exception thrown when storage not found | ||
*/ | ||
@Override | ||
public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException { | ||
List<Task> reminderList = addDeadlines(taskList); | ||
display(reminderList, ui); | ||
} | ||
|
||
/** | ||
* Returns a List of Task objects. | ||
* Adds objects of type Deadline to reminderList. | ||
* | ||
* @param taskList of user inputs | ||
*/ | ||
private List<Task> addDeadlines(TaskList taskList) { | ||
ArrayList<Task> reminderList = new ArrayList<>(); | ||
for (Task task : taskList.getTasks()) { | ||
if (task instanceof Deadline) { | ||
reminderList.add(task); | ||
} | ||
} | ||
return reminderList; | ||
} | ||
|
||
/** | ||
* Displays deadlines to user. | ||
*/ | ||
private void display(List<Task> reminderList, Ui ui) { | ||
if (reminderList.size() == 0) { | ||
ui.showNoDeadlines(); | ||
} else { | ||
ui.showDeadlines(reminderList); | ||
} | ||
} | ||
package duchess.logic.commands; | ||
|
||
import duchess.storage.Storage; | ||
import duchess.logic.commands.exceptions.DukeException; | ||
import duchess.storage.task.Deadline; | ||
import duchess.storage.task.Task; | ||
import duchess.storage.task.TaskList; | ||
import duchess.ui.Ui; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Searches Tasklist and filters out deadline objects. | ||
*/ | ||
public class ReminderCommand extends Command { | ||
|
||
/** | ||
* Displays Deadline objects to user. | ||
* | ||
* @param taskList List containing tasks | ||
* @param ui Userinterface object | ||
* @param storage Storage object | ||
* @throws DukeException Exception thrown when storage not found | ||
*/ | ||
@Override | ||
public void execute(TaskList taskList, Ui ui, Storage storage) throws DukeException { | ||
List<Task> reminderList = addDeadlines(taskList); | ||
display(reminderList, ui); | ||
} | ||
|
||
/** | ||
* Returns a List of Task objects. | ||
* Adds objects of type Deadline to reminderList. | ||
* | ||
* @param taskList of user inputs | ||
*/ | ||
private List<Task> addDeadlines(TaskList taskList) { | ||
ArrayList<Task> reminderList = new ArrayList<>(); | ||
for (Task task : taskList.getTasks()) { | ||
if (task instanceof Deadline) { | ||
reminderList.add(task); | ||
} | ||
} | ||
return reminderList; | ||
} | ||
|
||
/** | ||
* Displays deadlines to user. | ||
*/ | ||
private void display(List<Task> reminderList, Ui ui) { | ||
if (reminderList.size() == 0) { | ||
ui.showNoDeadlines(); | ||
} else { | ||
ui.showDeadlines(reminderList); | ||
} | ||
} | ||
} |
12 changes: 7 additions & 5 deletions
12
...main/java/duke/command/SnoozeCommand.java → ...duchess/logic/commands/SnoozeCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
...ava/duke/command/ViewScheduleCommand.java → ...s/logic/commands/ViewScheduleCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/duke/dukeexception/DukeException.java → ...ic/commands/exceptions/DukeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 16 additions & 14 deletions
30
src/main/java/Parser.java → ...ain/java/duchess/logic/parser/Parser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/duke/command/Schedule.java → src/main/java/duchess/model/Schedule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package duke.command; | ||
package duchess.model; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
6 changes: 3 additions & 3 deletions
6
src/main/java/duke/command/Storage.java → src/main/java/duchess/storage/Storage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/main/java/duke/task/Deadline.java → ...n/java/duchess/storage/task/Deadline.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/main/java/duke/task/Event.java → ...main/java/duchess/storage/task/Event.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/duke/task/Snoozeable.java → ...java/duchess/storage/task/Snoozeable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package duke.task; | ||
package duchess.storage.task; | ||
|
||
public interface Snoozeable { | ||
void snooze(); | ||
|
4 changes: 2 additions & 2 deletions
4
src/main/java/duke/task/Task.java → src/main/java/duchess/storage/task/Task.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.