|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
ArrayListModel<E>
public class ArrayListModel<E>
ArrayList which can be used as a ListModel in UI code
| Field Summary | |
|---|---|
static ArrayListModel |
EMPTY_LIST
The empty list (immutable). |
protected java.util.List<javax.swing.event.ListDataListener> |
listDataListeners
List of ListDataListeners |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
ArrayListModel()
|
|
| Method Summary | |
|---|---|
boolean |
add(E o)
Augments superclass method to fire an appropriate event when an item is added to the collection |
void |
add(int index,
E element)
Augments superclass method to fire an appropriate event when an item is added to the collection. |
boolean |
addAll(java.util.Collection<? extends E> coll)
Augments superclass method to fire an appropriate event when a collection is added to this collection |
void |
addListDataListener(javax.swing.event.ListDataListener listener)
Implementation of the method in the ListModel interface |
void |
clear()
Augments superclass method to fire an appropriate event when the collection is emptied |
protected void |
fireIntervalAdded(int firstIndex,
int lastIndex)
Helper method to fire an event to all listeners when an interval in the collection is added |
protected void |
fireIntervalRemoved(int firstIndex,
int lastIndex)
Helper method to fire an event to all listeners when an interval in the collection is removed |
protected void |
fireIntervalUpdated(int firstIndex,
int lastIndex)
Helper method to fire an event to all listeners when an interval in the collection is updated |
java.lang.Object |
getElementAt(int index)
Implementation of the method in the ListModel interface |
int |
getSize()
Implementation of the method in the ListModel interface |
E |
remove(int index)
Augments superclass method to fire an appropriate event when the element at the given index is removed from the collection |
boolean |
remove(java.lang.Object obj)
Overrides superclass method, forwarding it to the remove(index) method
so the appropriate event can be fired. |
boolean |
removeAll(java.util.Collection coll)
Augments superclass method to fire an appropriate event when the given collection is removed from this collection |
void |
removeListDataListener(javax.swing.event.ListDataListener listener)
Implementation of the method in the ListModel interface |
void |
removeRange(int fromIndex,
int toIndex)
Augments superclass method to fire an appropriate event when a range of items is removed from the collection |
boolean |
retainAll(java.util.Collection<?> c)
Augments superclass method to fire an appropriate event when the given collection is retained in this collection |
E |
set(int index,
E element)
Augments superclass method to fire an appropriate event when an item in the collection is modified |
| Methods inherited from class java.util.ArrayList |
|---|
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, subList |
| Field Detail |
|---|
public static final ArrayListModel EMPTY_LIST
protected java.util.List<javax.swing.event.ListDataListener> listDataListeners
| Constructor Detail |
|---|
public ArrayListModel()
| Method Detail |
|---|
public void add(int index,
E element)
add in interface java.util.List<E>add in class java.util.ArrayList<E>index - intobj - Objectpublic boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.List<E>add in class java.util.ArrayList<E>o - E
Collection.add())public boolean addAll(java.util.Collection<? extends E> coll)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>addAll in class java.util.ArrayList<E>coll - Collection
public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.List<E>clear in class java.util.ArrayList<E>public E remove(int index)
remove in interface java.util.List<E>remove in class java.util.ArrayList<E>index - int
public boolean remove(java.lang.Object obj)
remove(index) method
so the appropriate event can be fired.
remove in interface java.util.Collection<E>remove in interface java.util.List<E>remove in class java.util.ArrayList<E>obj - Object
public void removeRange(int fromIndex,
int toIndex)
removeRange in class java.util.ArrayList<E>fromIndex - inttoIndex - intpublic boolean removeAll(java.util.Collection coll)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>removeAll in class java.util.AbstractCollection<E>coll - Collection
public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>retainAll in class java.util.AbstractCollection<E>coll - Collectionboolean - true if successful
public E set(int index,
E element)
set in interface java.util.List<E>set in class java.util.ArrayList<E>index - intelement - Objectpublic int getSize()
getSize in interface javax.swing.ListModelListModel.getSize()public java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelindex - int
ListModel.getElementAt(int)public void addListDataListener(javax.swing.event.ListDataListener listener)
addListDataListener in interface javax.swing.ListModellistener - ListDataListenerListModel.addListDataListener(javax.swing.event.ListDataListener)public void removeListDataListener(javax.swing.event.ListDataListener listener)
removeListDataListener in interface javax.swing.ListModellistener - ListDataListenerListModel.removeListDataListener(javax.swing.event.ListDataListener)
protected void fireIntervalAdded(int firstIndex,
int lastIndex)
firstIndex - intlastIndex - int
protected void fireIntervalRemoved(int firstIndex,
int lastIndex)
firstIndex - intlastIndex - int
protected void fireIntervalUpdated(int firstIndex,
int lastIndex)
firstIndex - intlastIndex - int
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||