Skip to content

Commit

Permalink
Update collated files.
Browse files Browse the repository at this point in the history
  • Loading branch information
bertoia committed Nov 1, 2016
1 parent daf3d6d commit ce01549
Show file tree
Hide file tree
Showing 2 changed files with 693 additions and 2 deletions.
30 changes: 29 additions & 1 deletion collated/main/A0121501E.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
```
###### /java/seedu/address/logic/commands/MarkCommand.java
``` java
/**
* Marks an entry as completed.
*/
public class MarkCommand extends UndoableCommand {
public static final String COMMAND_WORD = "mark";

Expand Down Expand Up @@ -146,6 +149,9 @@ public class MarkCommand extends UndoableCommand {
```
###### /java/seedu/address/logic/commands/RedoCommand.java
``` java
/**
* Redo the previous undo command.
*/
public class RedoCommand extends Command {

public static final String COMMAND_WORD = "redo";
Expand Down Expand Up @@ -176,6 +182,9 @@ public class RedoCommand extends Command {
```
###### /java/seedu/address/logic/commands/TagCommand.java
``` java
/*
* Add tags to an entry. Does not overwrite existing tags.
*/
public class TagCommand extends UndoableCommand {

public static final String COMMAND_WORD = "tag";
Expand Down Expand Up @@ -258,6 +267,10 @@ public class TagCommand extends UndoableCommand {
```
###### /java/seedu/address/logic/commands/UndoableCommand.java
``` java
/**
* Represents a command which changes to the model can be undone using the undo command
* and redone using the redo command
*/
public abstract class UndoableCommand extends Command {

public enum CommandState {UNDOABLE, REDOABLE, PRE_EXECUTION};
Expand All @@ -267,6 +280,9 @@ public abstract class UndoableCommand extends Command {
public CommandState commandState = CommandState.PRE_EXECUTION;
public abstract CommandResult unexecute();

/**
* Re-executes the command which was previously undone.
*/
public CommandResult reExecute() {
if (getCommandState()!=CommandState.REDOABLE){
return new CommandResult(MESSAGE_UNDO_FAIL);
Expand All @@ -289,6 +305,9 @@ public abstract class UndoableCommand extends Command {
```
###### /java/seedu/address/logic/commands/UndoableCommandHistory.java
``` java
/**
* Stack of successfully executed undoable commands.
*/
public class UndoableCommandHistory {
Deque<UndoableCommand> commandInternalUndoQueue = new ArrayDeque<UndoableCommand>();
Deque<UndoableCommand> commandInternalRedoQueue = new ArrayDeque<UndoableCommand>();
Expand Down Expand Up @@ -327,6 +346,9 @@ public class UndoableCommandHistory {
```
###### /java/seedu/address/logic/commands/UndoCommand.java
``` java
/**
* Undo the previous undoable command.
*/
public class UndoCommand extends Command {

public static final String COMMAND_WORD = "undo";
Expand Down Expand Up @@ -357,11 +379,14 @@ public class UndoCommand extends Command {
```
###### /java/seedu/address/logic/commands/UnmarkCommand.java
``` java
/**
* Unmarks an entry.
*/
public class UnmarkCommand extends UndoableCommand {
public static final String COMMAND_WORD = "unmark";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Unmarks the entry as completed. "
+ ": Unmarks the entry. "
+ "Identified by the index number used in the last entry listing.\n"
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";
Expand Down Expand Up @@ -428,6 +453,9 @@ public class UnmarkCommand extends UndoableCommand {
```
###### /java/seedu/address/logic/commands/UntagCommand.java
``` java
/*
* Remove tags from an entry.
*/
public class UntagCommand extends UndoableCommand {

public static final String COMMAND_WORD = "untag";
Expand Down
Loading

0 comments on commit ce01549

Please sign in to comment.