From acb25c312060a0009d37e46a4e4a65d7bf1200e8 Mon Sep 17 00:00:00 2001 From: kske Date: Wed, 8 Dec 2021 10:35:09 +0100 Subject: [PATCH] Improve ChangeManager Javadoc --- .../java/dev/kske/undoredo/ChangeManager.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/main/java/dev/kske/undoredo/ChangeManager.java b/src/main/java/dev/kske/undoredo/ChangeManager.java index 8f2812e..6d520c2 100644 --- a/src/main/java/dev/kske/undoredo/ChangeManager.java +++ b/src/main/java/dev/kske/undoredo/ChangeManager.java @@ -3,7 +3,11 @@ package dev.kske.undoredo; import java.util.*; /** - * @param the change types to store in this change manager + * A change manager keeps track of subsequent changes and allows un- and redoing them. A specific + * change can be marked using {@link #mark()} to keep track of a saved state in the application that + * uses the manager. + * + * @param the change type to store in this change manager * @author Maximilian Käfer * @since 0.0.1 */ @@ -15,8 +19,8 @@ public final class ChangeManager { private int markedIndex; /** - * Adds a change to the changes list. - * + * Applies the given change and appends it to the change list. + * * @param change the change to add * @since 0.0.1 */ @@ -26,9 +30,9 @@ public final class ChangeManager { } /** - * Undoes the change at the current index position. - * - * @return whether the operation could be executed due to one being currently available + * Undoes the current change. + * + * @return whether an action was performed * @since 0.1.0 */ public boolean undo() { @@ -42,8 +46,8 @@ public final class ChangeManager { /** * Applies the change that was undone before. - * - * @return whether the operation could be executed due to one being currently available + * + * @return whether an action was performed * @since 0.0.1 */ public boolean redo() { @@ -56,8 +60,8 @@ public final class ChangeManager { } /** - * Marks the current index. - * + * Marks the current change. + * * @since 0.0.1 */ public void mark() { @@ -65,7 +69,7 @@ public final class ChangeManager { } /** - * @return whether the current index was marked + * @return whether the current change is marked * @since 0.0.1 */ public boolean isAtMarkedIndex() { @@ -73,7 +77,7 @@ public final class ChangeManager { } /** - * @return whether the undo operation is currently available + * @return whether a change is present that can be undone * @since 0.0.1 */ public boolean isUndoAvailable() { @@ -81,7 +85,7 @@ public final class ChangeManager { } /** - * @return whether the redo operation is currently available. + * @return whether a change is present that can be redone * @since 0.0.1 */ public boolean isRedoAvailable() { @@ -90,7 +94,7 @@ public final class ChangeManager { /** * Provides an unmodifiable view of the changes stored in this change manager. - * + * * @return all stored changes * @since 0.0.1 */