|
||||||||||
| 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>
com.jgoodies.common.collect.ArrayListModel<E>
E - the type of the list elementspublic class ArrayListModel<E>
Adds ListModel capabilities to its superclass
It allows to observe changes in the content and structure. Useful fo
Lists that are bound to list views such as JList, JComboBox and JTable.
ObservableList,
LinkedListModel,
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
ArrayListModel()
Constructs an empty list with an initial capacity of ten. |
|
ArrayListModel(Collection<? extends E> c)
Constructs a list containing the elements of the specified collection in the order they are returned by the collection's iterator. |
|
ArrayListModel(int initialCapacity)
Constructs an empty list with the specified initial capacity. |
|
| Method Summary | |
|---|---|
boolean |
add(E e)
|
void |
add(int index,
E element)
|
boolean |
addAll(Collection<? extends E> c)
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
void |
addListDataListener(ListDataListener l)
|
void |
clear()
|
void |
fireContentsChanged(int index)
Notifies all registered ListDataListeners that the elemen
at the specified index has changed. |
Object |
getElementAt(int index)
|
ListDataListener[] |
getListDataListeners()
Returns an array of all the list data listener registered on this ArrayListModel. |
int |
getSize()
|
E |
remove(int index)
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection<?> c)
Removes from this collection all of its elements that are contained i the specified collection (optional operation). |
void |
removeListDataListener(ListDataListener l)
|
protected void |
removeRange(int fromIndex,
int toIndex)
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in th specified collection (optional operation). |
E |
set(int index,
E element)
|
| Methods inherited from class java.util.ArrayList |
|---|
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 |
|---|
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, size, subList, toArray, toArray |
| Constructor Detail |
|---|
public ArrayListModel()
public ArrayListModel(int initialCapacity)
initialCapacity - the initial capacity of the list.
IllegalArgumentException - if the specified initial capacit
is negativepublic ArrayListModel(Collection<? extends E> c)
ArrayListModel instance has an initial capacity o
110% the size of the specified collection.
c - the collection whose elements are to be placed into this list.
NullPointerException - if the specified collection i
null| Method Detail |
|---|
public final void add(int index,
E element)
add in interface List<E>add in class ArrayList<E>public final boolean add(E e)
add in interface Collection<E>add in interface List<E>add in class ArrayList<E>
public final boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>addAll in class ArrayList<E>public final boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>addAll in class ArrayList<E>public boolean removeAll(Collection<?> c)
remove method.
UnsupportedOperationException if the iterator returned by th iterator method does not implement the remove metho and this collection contains one or more elements in common with th specified collection.
removeAll in interface Collection<E>removeAll in interface List<E>removeAll in class AbstractCollection<E>c - elements to be removed from this collection.
UnsupportedOperationException - if the removeAll metho
is not supported by this collection.
NullPointerException - if the specified collection is null.remove(Object),
ArrayList.contains(Object)public boolean retainAll(Collection<?> c)
remove method.
UnsupportedOperationException if the iterator returned by th iterator method does not implement the remove metho and this collection contains one or more elements not present in th specified collection.
retainAll in interface Collection<E>retainAll in interface List<E>retainAll in class AbstractCollection<E>c - elements to be retained in this collection.
UnsupportedOperationException - if the retainAll metho
is not supported by this Collection.
NullPointerException - if the specified collection is null.remove(Object),
ArrayList.contains(Object)public final void clear()
clear in interface Collection<E>clear in interface List<E>clear in class ArrayList<E>public final E remove(int index)
remove in interface List<E>remove in class ArrayList<E>public final boolean remove(Object o)
remove in interface Collection<E>remove in interface List<E>remove in class ArrayList<E>
protected final void removeRange(int fromIndex,
int toIndex)
removeRange in class ArrayList<E>
public final E set(int index,
E element)
set in interface List<E>set in class ArrayList<E>public final void addListDataListener(ListDataListener l)
addListDataListener in interface ListModelpublic final void removeListDataListener(ListDataListener l)
removeListDataListener in interface ListModelpublic final Object getElementAt(int index)
getElementAt in interface ListModelpublic final int getSize()
getSize in interface ListModelpublic final void fireContentsChanged(int index)
ListDataListeners that the elemen
at the specified index has changed. Useful if there's a content chang
without any structural change.after the element of the list changes.
index - the index of the element that has changedEventListenerListpublic final ListDataListener[] getListDataListeners()
ArrayListModel.
ListDataListeners
or an empty array if no list data listener
are currently registeredaddListDataListener(ListDataListener),
removeListDataListener(ListDataListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||