Basic API Structure #2
@ -3,7 +3,11 @@ package dev.kske.undoredo;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
kske marked this conversation as resolved
Outdated
|
||||
* @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
kske
commented
Replace 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ä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> {
|
||||
}
|
||||
|
||||
kske marked this conversation as resolved
Outdated
kske
commented
"whether an action was performed" "whether an action was performed"
|
||||
/**
|
||||
* 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> {
|
||||
|
||||
kske marked this conversation as resolved
Outdated
kske
commented
"whether an action was performed" "whether an action was performed"
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user
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."