Improve ChangeManager Javadoc

This commit is contained in:
Kai S. K. Engelbart 2021-12-08 10:35:09 +01:00
parent fe1009187c
commit acb25c3120
Signed by: kske
GPG Key ID: 8BEB13EC5DF7EF13
1 changed files with 18 additions and 14 deletions

View File

@ -3,7 +3,11 @@ package dev.kske.undoredo;
import java.util.*;
/**
* @param <C> 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 <C> the change type to store in this change manager
* @author Maximilian K&auml;fer
* @since 0.0.1
*/
@ -15,8 +19,8 @@ public final class ChangeManager<C extends Change> {
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<C extends Change> {
}
/**
* 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<C extends Change> {
/**
* 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<C extends Change> {
}
/**
* Marks the current index.
*
* Marks the current change.
*
* @since 0.0.1
*/
public void mark() {
@ -65,7 +69,7 @@ public final class ChangeManager<C extends Change> {
}
/**
* @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<C extends Change> {
}
/**
* @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<C extends Change> {
}
/**
* @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<C extends Change> {
/**
* Provides an unmodifiable view of the changes stored in this change manager.
*
*
* @return all stored changes
* @since 0.0.1
*/