-
Notifications
You must be signed in to change notification settings - Fork 73
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
[W6.2f][F09-3]Sarah Taaher Bonna #129
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,13 +39,15 @@ public static String getMessageForPersonListShownSummary(List<? extends ReadOnly | |
/** | ||
* Executes the command and returns the result. | ||
*/ | ||
public CommandResult execute(){ | ||
throw new UnsupportedOperationException("This method should be implement in child classes"); | ||
} | ||
// public CommandResult execute(){ | ||
// throw new UnsupportedOperationException("This method should be implement in child classes"); | ||
// } | ||
|
||
//Note: it is better to make the execute() method abstract, by replacing the above method with the line below: | ||
//public abstract CommandResult execute(); | ||
|
||
public abstract CommandResult execute(); | ||
|
||
/** | ||
* Supplies the data the command will operate on. | ||
*/ | ||
|
@@ -70,4 +72,9 @@ public int getTargetIndex() { | |
public void setTargetIndex(int targetIndex) { | ||
this.targetIndex = targetIndex; | ||
} | ||
|
||
public boolean isMutating(String userCommandText) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method should have a header comment. If not, users of the method as well as those who overrides method will not know how exactly the method behaves. Also, as pointed out in the other PR, you should make use of polymorphism and implement the different behavior in individual sub classes |
||
if(userCommandText == "add" || userCommandText == "delete") return true; | ||
else return false; | ||
} | ||
} |
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.
Don't leave commented out code. Just go ahead and delete removed code, as we can recover them later