ur_rna.StructureEditor.services

## Class History<T>

- java.lang.Object
- - ur_rna.StructureEditor.services.History<T>

-     public class History<T>
      extends java.lang.Object

  Stores the history of an arbitrary model for undo/redo

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `pos`
    `private java.util.ArrayList<T>` | `stack`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `History()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canRedo()`
    `boolean` | `canUndo()`
    `void` | `clear()`
    `private void` | `clearRedo()` Clear all entries in front of the current position.
    `T` | `current()`
    `java.util.List<T>` | `entries()`
    `T` | `get(int position)`
    `int` | `position()`
    `T` | `redo()`
    `int` | `size()`
    `void` | `store(T state)` Store the current state of the model.
    `T` | `undo()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### pos

          private int pos

    - #### stack

          private java.util.ArrayList<T> stack

  - ### Constructor Detail

    - #### History

          public History()

  - ### Method Detail

    - #### canRedo

          public boolean canRedo()

    - #### canUndo

          public boolean canUndo()

    - #### clear

          public void clear()

    - #### clearRedo

          private void clearRedo()

      Clear all entries in front of the current position.

    - #### current

          public T current()

    - #### entries

          public java.util.List<T> entries()

    - #### get

          public T get(int position)

    - #### position

          public int position()

    - #### redo

          public T redo()

    - #### size

          public int size()

    - #### store

          public void store(T state)

      Store the current state of the model. Typically this clears all history in front of the current entry.
      Parameters:
        `state` - The current state of the model.

    - #### undo

          public T undo()