Basic API Structure #2

Merged
kske merged 12 commits from f/basics into develop 2021-12-11 21:45:59 +01:00
Showing only changes of commit acb25c3120 - Show all commits

View File

@ -3,7 +3,11 @@ package dev.kske.undoredo;
import java.util.*;
/**
kske marked this conversation as resolved Outdated
Outdated
Review

The main description of the class is missing. I suggest something along the lines of:

"A change manager keeps track of subsequent changes and allows un- and redoing them. A specific position can be marked using {@link ...} to keep track of a saved state in the application that uses the manager."

The main description of the class is missing. I suggest something along the lines of: "A change manager keeps track of subsequent changes and allows un- and redoing them. A specific position can be marked using {@link ...} to keep track of a saved state in the application that uses the manager."
* @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
kske marked this conversation as resolved Outdated
Outdated
Review

Replace types by type, as the user only specifies one parameter.

Replace `types` by `type`, as the user only specifies one parameter.
* 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,7 +19,7 @@ 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> {
}
kske marked this conversation as resolved Outdated
Outdated
Review

"whether an action was performed"

"whether an action was performed"
/**
* Undoes the change at the current index position.
* Undoes the current change.
*
* @return whether the operation could be executed due to one being currently available
* @return whether an action was performed
* @since 0.1.0
*/
public boolean undo() {
@ -43,7 +47,7 @@ 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,7 +60,7 @@ public final class ChangeManager<C extends Change> {
}
/**
* Marks the current index.
* Marks the current change.
*
* @since 0.0.1
*/
@ -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() {