diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 4abb17e3e..dcd667081 100644 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -111,6 +111,19 @@ Deletes the 2nd person in the address book. `delete 1` + Deletes the 1st person in the results of the `find` command. +== Pseudo Sorting : `dummysort` + +Psuedo sorts the address book in alphabetical order (mimics how a sort would be implemented by laying out the skeletal structure as well as pinpoint the files within the project to be updated.) +Format: `dummysort` + +**** +Supposedly takes all the entries of the address book and sorts the names in alphabetical order. +**** + +Examples: + +* `dummysort` + + == View non-private details of a person : `view` Displays the non-private details of the specified person. + diff --git a/src/seedu/addressbook/Main.java b/src/seedu/addressbook/Main.java index bc18bed7e..023548cbd 100644 --- a/src/seedu/addressbook/Main.java +++ b/src/seedu/addressbook/Main.java @@ -21,9 +21,9 @@ * Initializes the application and starts the interaction with the user. */ public class Main { - + // test commit /** Version info of the program. */ - public static final String VERSION = "AddressBook Level 2 - Version 1.0"; + public static final String VERSION = "AddressBook Level 2 - Version 1.1"; private TextUi ui; private StorageFile storage; diff --git a/src/seedu/addressbook/commands/DummySortCommand.java b/src/seedu/addressbook/commands/DummySortCommand.java new file mode 100644 index 000000000..55d3ec88d --- /dev/null +++ b/src/seedu/addressbook/commands/DummySortCommand.java @@ -0,0 +1,32 @@ +package seedu.addressbook.commands; + +import java.util.HashSet; +import java.util.Set; + +import seedu.addressbook.data.exception.IllegalValueException; +import seedu.addressbook.data.person.Address; +import seedu.addressbook.data.person.Email; +import seedu.addressbook.data.person.Name; +import seedu.addressbook.data.person.Person; +import seedu.addressbook.data.person.Phone; +import seedu.addressbook.data.person.ReadOnlyPerson; +import seedu.addressbook.data.person.UniquePersonList; +import seedu.addressbook.data.tag.Tag; + +/** + * Adds a person to the address book. + */ +public class DuummySortCommand extends Command { + + public static final String COMMAND_WORD = "dummysort"; + + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Psuedo sorts contacts in the address book in alphabetical order.\n" + + "Example: " + COMMAND_WORD; + + public static final String MESSAGE_SUCCESS = "Address book is sorted in alphabetical order! ^^"; + + @Override + public CommandResult execute() { + return new CommandResult(MESSAGE_SUCCESS); + } +} diff --git a/src/seedu/addressbook/commands/HelpCommand.java b/src/seedu/addressbook/commands/HelpCommand.java index 9be217d89..2681786a9 100644 --- a/src/seedu/addressbook/commands/HelpCommand.java +++ b/src/seedu/addressbook/commands/HelpCommand.java @@ -15,6 +15,7 @@ public class HelpCommand extends Command { public CommandResult execute() { return new CommandResult( AddCommand.MESSAGE_USAGE + + "\n" + DummySortCommand.MESSAGE_USAGE + "\n" + DeleteCommand.MESSAGE_USAGE + "\n" + ClearCommand.MESSAGE_USAGE + "\n" + FindCommand.MESSAGE_USAGE diff --git a/src/seedu/addressbook/parser/Parser.java b/src/seedu/addressbook/parser/Parser.java index abddb3f45..5f14d740b 100644 --- a/src/seedu/addressbook/parser/Parser.java +++ b/src/seedu/addressbook/parser/Parser.java @@ -79,7 +79,10 @@ public Command parseCommand(String userInput) { case DeleteCommand.COMMAND_WORD: return prepareDelete(arguments); - case ClearCommand.COMMAND_WORD: + case DummySortCommand.COMMAND_WORD: + return new DummySortCommand(); + + case ClearCommand.COMMAND_WORD return new ClearCommand(); case FindCommand.COMMAND_WORD: