Skip to content

Commit

Permalink
Add packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jehousoh committed Aug 22, 2022
1 parent f396746 commit 238e416
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions data/duke.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[T]--[ ]--hi
[D]--[ ]--ddd--Mar 4 2022
3 changes: 2 additions & 1 deletion src/main/java/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import java.nio.file.Paths;
import java.io.File;
import java.io.IOException;

import duke.task.*;
import duke.helper.*;
public class Duke {
/**
* Main class used to handle inputs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.exception;
public class InvalidCommandException extends Exception {
/**
* Exception for invalid command
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.exception;
public class InvalidDateException extends Exception {
/**
* Exception for input with invalid date/time
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.exception;
public class NoDescriptionException extends Exception {
/**
* Exception for input with no description
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.helper;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package duke.helper;

import java.io.IOException;
import java.io.FileWriter;

import duke.task.*;
public class FileWriting {
/**
* Class to update .txt file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
package duke.helper;

import duke.task.*;
import duke.exception.*;
public class Parser {

public static void parse(String in, TaskList list) {
Expand Down Expand Up @@ -41,7 +45,7 @@ public static void parse(String in, TaskList list) {
throw new InvalidCommandException();
} else if (task.getClass() == ErrorTask.class) {
throw new InvalidDateException();
} else if (task.description.length() < 1) {
} else if (task.getDescription().length() < 1) {
throw new NoDescriptionException();
} else {
list.add(task);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package duke.helper;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Scanner;
import duke.task.*;

public class Storage {

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/Ui.java → src/main/java/duke/helper/Ui.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package duke.helper;
import duke.task.*;
public class Ui {
/**
* Child containing default messages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.task;
import java.time.LocalDate;

public class Deadline extends Task {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.task;
public class ErrorTask extends Task {
/**
* Child class of Task with an error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.task;
public class Event extends Task {
/**
* Child class of Task with a date and time
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.task;
public class Task {
/**
* Parent class to manage all the Task
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package duke.task;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import duke.helper.DateTimeConverter;

public class TaskCreator {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package duke.task;
import java.util.ArrayList;
import duke.helper.Ui;

public class TaskList {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package duke.task;
public class Todo extends Task {
/**
* Child class of Task without any date/time attached to it
Expand Down

0 comments on commit 238e416

Please sign in to comment.