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:
  `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 List<IHistoryElement<T>>`
`elements`

## Constructor Summary

Constructors
Constructor
Description
`History()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`add(T data)`
`protected final void`
`changed()`
`boolean`
`clear()`
`protected IHistoryElement<T>`
`createElement(T data)`
`IHistoryElement<T>`
`get(int index)`
`<D> D[]`
`getData(D[] a)`
`List<IHistoryElement<T>>`
`getElements()`
`T`
`getMostRecent()`
`int`
`indexOf(T data)`
`boolean`
`isEmpty()`
`Iterator<IHistoryElement<T>>`
`iterator()`
`protected void`
`load()`
`IHistoryElement<T>`
`remove(int index)`
`protected void`
`save()`
`void`
`setElements(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 Details

### elements

protected List<IHistoryElement<T>> elements

## Constructor Details

### History

public History()

## Method Details

### getElements

public List<IHistoryElement<T>> getElements()

### setElements

public void setElements(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 Iterator<IHistoryElement<T>> iterator()

Specified by:
  `iterator` in interface `Iterable<T>`

### createElement

protected IHistoryElement<T> createElement(T data)

### load

protected void load()

### save

protected void save()

### changed

protected final void changed()