Package org.eclipse.net4j.util.collection

## Class History<T>

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.collection.History<T>

- All Implemented Interfaces:
    `java.lang.Iterable<IHistoryElement<T>>`, `IHistory<T>`, `INotifier`, `INotifier.INotifier2`
  Direct Known Subclasses:
    `PreferenceHistory`

      public class History<T>
      extends Notifier
      implements IHistory<T>

  Author:
    Eike Stepper

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier

      `INotifier.INotifier2`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.util.List<IHistoryElement<T>>` | `elements` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `History()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `add​(T data)` |
    `protected void` | `changed()` |
    `boolean` | `clear()` |
    `protected IHistoryElement<T>` | `createElement​(T data)` |
    `IHistoryElement<T>` | `get​(int index)` |
    `<D> D[]` | `getData​(D[] a)` |
    `java.util.List<IHistoryElement<T>>` | `getElements()` |
    `T` | `getMostRecent()` |
    `int` | `indexOf​(T data)` |
    `boolean` | `isEmpty()` |
    `java.util.Iterator<IHistoryElement<T>>` | `iterator()` |
    `protected void` | `load()` |
    `IHistoryElement<T>` | `remove​(int index)` |
    `protected void` | `save()` |
    `void` | `setElements​(java.util.List<IHistoryElement<T>> newElements)` |
    `int` | `size()` |
    `IHistoryElement<T>[]` | `toArray()` |

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener`

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

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

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### elements

          protected java.util.List<IHistoryElement<T>> elements

  - ### Constructor Detail

    - #### History

          public History()

  - ### Method Detail

    - #### getElements

          public java.util.List<IHistoryElement<T>> getElements()

    - #### setElements

          public void setElements​(java.util.List<IHistoryElement<T>> newElements)

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `IHistory<T>`

    - #### size

          public int size()

      Specified by:
        `size` in interface `IHistory<T>`

    - #### indexOf

          public int indexOf​(T data)

      Specified by:
        `indexOf` in interface `IHistory<T>`

    - #### get

          public IHistoryElement<T> get​(int index)

      Specified by:
        `get` in interface `IHistory<T>`

    - #### add

          public boolean add​(T data)

      Specified by:
        `add` in interface `IHistory<T>`

    - #### remove

          public IHistoryElement<T> remove​(int index)

      Specified by:
        `remove` in interface `IHistory<T>`

    - #### clear

          public boolean clear()

      Specified by:
        `clear` in interface `IHistory<T>`

    - #### getMostRecent

          public T getMostRecent()

      Specified by:
        `getMostRecent` in interface `IHistory<T>`

    - #### getData

          public <D> D[] getData​(D[] a)

      Specified by:
        `getData` in interface `IHistory<T>`

    - #### toArray

          public IHistoryElement<T>[] toArray()

      Specified by:
        `toArray` in interface `IHistory<T>`

    - #### iterator

          public java.util.Iterator<IHistoryElement<T>> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<T>`

    - #### createElement

          protected IHistoryElement<T> createElement​(T data)

    - #### load

          protected void load()

    - #### save

          protected void save()

    - #### changed

          protected final void changed()