Skip to content

Commit

Permalink
Command class: make non-abstract
Browse files Browse the repository at this point in the history
Command class is abstract.

Abstract classes are not an LO covered at level2.

Let's make Command class non-abstract so that students who haven't
learned about abstract classes are not confused by it.
  • Loading branch information
damithc committed Aug 31, 2017
1 parent f94fe28 commit de7ef4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file modified doc/Diagrams.pptx
Binary file not shown.
Binary file modified doc/images/mainClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/seedu/addressbook/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Represents an executable command.
*/
public abstract class Command {
public class Command {
protected AddressBook addressBook;
protected List<? extends ReadOnlyPerson> relevantPersons;
private int targetIndex = -1;
Expand Down Expand Up @@ -39,7 +39,9 @@ public static String getMessageForPersonListShownSummary(List<? extends ReadOnly
/**
* Executes the command and returns the result.
*/
public abstract CommandResult execute();
public CommandResult execute(){
throw new UnsupportedOperationException("This method is to be implemented by child classes");
};

/**
* Supplies the data the command will operate on.
Expand Down

0 comments on commit de7ef4a

Please sign in to comment.