org.openstreetmap.josm.plugins.streetside.history

## Class StreetsideRecord

- java.lang.Object
- - org.openstreetmap.josm.plugins.streetside.history.StreetsideRecord

-     public class StreetsideRecord
      extends Object

  History record system in order to let the user undo and redo commands.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `List<StreetsideCommand>` | `commandList` The set of commands that have taken place or that have been undone.
    `private static StreetsideRecord` | `instance` The unique instance of the class.
    `private List<StreetsideRecordListener>` | `listeners`
    `int` | `position` Last written command.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreetsideRecord()` Main constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCommand(StreetsideCommand command)` Adds a new command to the list.
    `void` | `addListener(StreetsideRecordListener lis)` Adds a listener.
    `private void` | `fireRecordChanged()`
    `static StreetsideRecord` | `getInstance()` Returns the unique instance of the class.
    `void` | `redo()` Redoes latest undone action.
    `void` | `removeListener(StreetsideRecordListener lis)` Removes the given listener.
    `void` | `reset()` Resets the object to its start state.
    `void` | `undo()` Undo latest command.

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

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

- - ### Field Detail

    - #### instance

          private static StreetsideRecord instance

      The unique instance of the class.

    - #### listeners

          private final List<StreetsideRecordListener> listeners

    - #### commandList

          public List<StreetsideCommand> commandList

      The set of commands that have taken place or that have been undone.

    - #### position

          public int position

      Last written command.

  - ### Constructor Detail

    - #### StreetsideRecord

          public StreetsideRecord()

      Main constructor.

  - ### Method Detail

    - #### getInstance

          public static StreetsideRecord getInstance()

      Returns the unique instance of the class.
      Returns:
        The unique instance of the class.

    - #### addListener

          public void addListener(StreetsideRecordListener lis)

      Adds a listener.
      Parameters:
        `lis` - The listener to be added.

    - #### removeListener

          public void removeListener(StreetsideRecordListener lis)

      Removes the given listener.
      Parameters:
        `lis` - The listener to be removed.

    - #### addCommand

          public void addCommand(StreetsideCommand command)

      Adds a new command to the list.
      Parameters:
        `command` - The command to be added.

    - #### undo

          public void undo()

      Undo latest command.

    - #### redo

          public void redo()

      Redoes latest undone action.

    - #### fireRecordChanged

          private void fireRecordChanged()

    - #### reset

          public void reset()

      Resets the object to its start state.

JOSM Plugins