public class UndoableCollection<T>
extends java.util.AbstractCollection<T>
implements java.lang.Iterable<T>
| Modifier | Constructor and Description |
|---|---|
protected |
UndoableCollection(Workbook workbook)
Initializes a new instance of the
UndoableCollection class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCollectionListener(CollectionListener listener)
Registers listener so that it will receive events from the collection.
|
boolean |
contains(java.lang.Object o)
Determines whether an element is in the collection.
|
T |
get(int index)
Gets the item at the specified index.
|
protected Workbook |
getWorkbook()
Gets a reference to the parent
Workbook object. |
int |
indexOf(T item)
Searches for the specified item and returns the zero-based index of
the first occurrence within the entire collection.
|
java.util.Iterator<T> |
iterator() |
protected void |
onCollectionChanged(CollectionChangedEvent e)
Raises the
collectionChanged event. |
void |
removeCollectionListener(CollectionListener listener)
Unregisters listener so that it will no longer receive collection events.
|
int |
size()
Gets the number of items in the collection.
|
protected void |
trackAdd(int index,
T item)
Adds the specified item to the collection.
|
protected void |
trackClear()
Clears the collection.
|
protected void |
trackMove(int fromIndex,
int toIndex,
T item)
Moves the specified item to another position.
|
protected void |
trackRemove(int index,
T item)
Removes the specified item to the collection.
|
protected void |
trackReplace(int index,
T item,
T newItem)
Removes the specified item in the collection.
|
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringprotected UndoableCollection(Workbook workbook)
UndoableCollection class.workbook - The Workbook object this collection belongs to.public void addCollectionListener(CollectionListener listener)
listener - An object implementing the CollectionListener interface.public void removeCollectionListener(CollectionListener listener)
listener - An object implementing the WorkbookListener interface.public java.util.Iterator<T> iterator()
protected void onCollectionChanged(CollectionChangedEvent e)
collectionChanged event.e - An object providing the event data.protected void trackAdd(int index,
T item)
protected void trackRemove(int index,
T item)
protected void trackReplace(int index,
T item,
T newItem)
protected void trackMove(int fromIndex,
int toIndex,
T item)
protected void trackClear()
public int indexOf(T item)
item - The item to locate in the collection.public boolean contains(java.lang.Object o)
public int size()
public T get(int index)
index - The zero-based index of the item to get.