Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Edward Alvin] ip #294

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ThePrevailingOne
Copy link

No description provided.

@ThePrevailingOne ThePrevailingOne changed the title Create Duke Skeleton [Edward Alvin] ip Jan 30, 2022
Copy link

@ckcherry23 ckcherry23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code thus far looks good! 👍🏼
Just some suggestions and nits to fix.

Comment on lines +37 to +63
public static void processInput(InputType inputType, String[] value) {
switch(inputType) {
case LIST:
wordList.printList();
break;
case MARK:
wordList.markItem(Integer.parseInt(value[0]));
break;
case UNMARK:
wordList.unmarkItem(Integer.parseInt(value[0]));
break;
case TODO:
wordList.storeTodo(value[0]);
break;
case DEADLINE:
wordList.storeDeadline(value[0], value[1]);
break;
case EVENT:
wordList.storeEvent(value[0], value[1]);
break;
case BYE:
replyBye();
break;
case NONE:
break;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coding standard for this module requires no indentation for the case clauses under switch! Perhaps you can configure your IDE to follow this new standard by default.

@@ -0,0 +1,17 @@
public enum InputType {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting way to use enums!

@@ -0,0 +1,14 @@
public class Deadline extends WordListItem{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class Deadline extends WordListItem{
public class Deadline extends WordListItem {

Be careful with the spacing requirements for Egyptian style brackets!

Comment on lines +55 to +67
@Override
public String toString() {
int i = 1;
String str = "";
str += "------------------------------------\n";
for(WordListItem wordListItem: this.wordList) {
str += i + ". " + wordListItem + "\n";
i++;
}
str += "------------------------------------\n";
return str;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can make use of the toString() method of WordListItem directly in printList(), instead of returning a complicated String expression here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants