|
||||||||||
| 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>
be.ugent.caagt.swirl.lists.ArrayListModel<E>
public class ArrayListModel<E>
Implementation of ListModel that behaves like an
ArrayList and implements the interface List from
the collections API.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
ArrayListModel()
Constructs an empty list with an initial capacity of ten. |
|
ArrayListModel(java.util.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 o)
|
void |
add(int index,
E element)
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
|
void |
addListDataListener(javax.swing.event.ListDataListener l)
|
void |
clear()
|
protected void |
fireContentsChanged(java.lang.Object source,
int index0,
int index1)
Called after one or more elements of the list change. |
protected void |
fireIntervalAdded(java.lang.Object source,
int index0,
int index1)
Called after one or more elements are added to the model. |
protected void |
fireIntervalRemoved(java.lang.Object source,
int index0,
int index1)
Called after one or more elements are removed from the model. |
java.lang.Object |
getElementAt(int index)
|
int |
getSize()
|
E |
remove(int index)
|
boolean |
remove(java.lang.Object obj)
|
void |
removeListDataListener(javax.swing.event.ListDataListener l)
|
protected void |
removeRange(int fromIndex,
int toIndex)
|
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, removeAll, retainAll, 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, removeAll, retainAll, size, subList, toArray, toArray |
| Constructor Detail |
|---|
public ArrayListModel(int initialCapacity)
public ArrayListModel()
public ArrayListModel(java.util.Collection<? extends E> c)
ArrayListModel instance has an initial capacity of
110% the size of the specified collection.
c - the collection whose elements are to be placed into this list.
java.lang.NullPointerException - if the specified collection is null.| Method Detail |
|---|
public void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener in interface javax.swing.ListModelpublic void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener in interface javax.swing.ListModel
protected void fireIntervalRemoved(java.lang.Object source,
int index0,
int index1)
index0 and index1 are the end points
of the interval that's been removed. Note that index0
need not be less than or equal to index1.
source - the ArrayListModel that changed, typically "this"index0 - one end of the removed interval,
including index0index1 - the other end of the removed interval,
including index1AbstractListModel
protected void fireIntervalAdded(java.lang.Object source,
int index0,
int index1)
source - the ArrayListModel that changed, typically "this"index0 - one end of the new intervalindex1 - the other end of the new intervalAbstractListModel
protected void fireContentsChanged(java.lang.Object source,
int index0,
int index1)
source - the ArrayListModel that changed, typically "this"index0 - one end of the intervalindex1 - the other end of the intervalAbstractListModelpublic int getSize()
getSize in interface javax.swing.ListModelpublic java.lang.Object getElementAt(int index)
getElementAt in interface javax.swing.ListModelpublic 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>
public void add(int index,
E element)
add in interface java.util.List<E>add in class java.util.ArrayList<E>public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>addAll in class java.util.ArrayList<E>
public boolean addAll(int index,
java.util.Collection<? extends E> c)
addAll in interface java.util.List<E>addAll in class java.util.ArrayList<E>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 boolean remove(java.lang.Object obj)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>remove 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>
protected void removeRange(int fromIndex,
int toIndex)
removeRange in class java.util.ArrayList<E>
public E set(int index,
E element)
set in interface java.util.List<E>set in class java.util.ArrayList<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||