-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[zuohui48] ip #284
base: master
Are you sure you want to change the base?
[zuohui48] ip #284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge!
src/main/java/Parser.java
Outdated
public boolean checkTodo(String input) { | ||
|
||
return input.split(" ")[0].equals("todo"); | ||
} | ||
public boolean checkEvent(String input) { | ||
return input.split(" ")[0].equals("Event"); | ||
} | ||
public boolean checkDeadline(String input) { | ||
return input.split(" ")[0].equals("deadline"); | ||
} | ||
|
||
public boolean checkTask(String input) { | ||
String cmd = input.split(" ")[0]; | ||
return cmd.equals("deadline") || cmd.equals("todo") || cmd.equals("event"); | ||
} | ||
public boolean checkMark(String input) { | ||
return input.split(" ")[0].equals("mark"); | ||
} | ||
public boolean checkUnmark(String input) { | ||
return input.split(" ")[0].equals("unmark"); | ||
} | ||
public boolean checkList(String input) { | ||
return input.split(" ")[0].equals("list"); | ||
} | ||
public boolean checkBye(String input) { | ||
return input.split(" ")[0].equals("bye"); | ||
} | ||
public boolean checkDelete(String input) { | ||
return input.split(" ")[0].equals("delete"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean variables/methods should be named to sound like booleans.
src/main/java/Storage.java
Outdated
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.FileWriter; | ||
import java.io.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imported classes should always be listed explicitly.
src/main/java/Parser.java
Outdated
import java.util.Arrays; | ||
import java.util.stream.Stream; | ||
public class Parser { | ||
private static String[] VALID_COMMANDS = {"mark", "unmark", "list", "delete", "bye", "todo", "event", "deadline"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final keyword can be specified for constants
src/main/java/TaskList.java
Outdated
@@ -0,0 +1,136 @@ | |||
import java.util.ArrayList; | |||
public class TaskList { | |||
private ArrayList<Task> list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to be more clear of what list is this ? :)
There are important assumptions that should hold at various points in the code. The assert feature is use to ensure that none of these assumptions are being violeted.
Handle user input with Parser
Use assert feature
MrDuke
MrDuke helps you to micromanage all your tasks. It's
FASTSUPER FAST to useAll you need to do is,
And it is FREE!
You can:
If you are a Java programmer, you can use it to practice Java too. Here's the
main
method: