|
||||||||||
| 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<T>
org.tbee.swing.list.ArrayListModel<T>
public class ArrayListModel<T>
ArrayList which can be used as a ListModel in UI code
| Field Summary | |
|---|---|
protected List<ListDataListener> |
listDataListeners
List of ListDataListeners |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
ArrayListModel()
|
|
ArrayListModel(Collection<T> c)
|
|
ArrayListModel(int initialCapacity)
|
|
| Method Summary | |
|---|---|
void |
add(int index,
T element)
Augments superclass method to fire an appropriate event when an item is added to the collection. |
boolean |
add(T o)
Augments superclass method to fire an appropriate event when an item is added to the collection |
boolean |
addAll(Collection<? extends T> coll)
Augments superclass method to fire an appropriate event when a collection is added to this collection |
void |
addListDataListener(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 |
Object |
getElementAt(int index)
Implementation of the method in the ListModel interface |
List<T> |
getSelectedValues(int[] selectedIndices)
Easily get a list of selected values using the selectedIndices of the Jlist |
List<T> |
getSelectedValues(JList jlist)
Easily get a list of selected values using the selectedIndices of the Jlist |
int |
getSize()
Implementation of the method in the ListModel interface |
T |
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(Object obj)
Overrides superclass method, forwarding it to the remove(index) method so the appropriate event can be fired. |
boolean |
removeAll(Collection<?> coll)
Augments superclass method to fire an appropriate event when the given collection is removed from this collection |
void |
removeListDataListener(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(Collection<?> c)
Augments superclass method to fire an appropriate event when the given collection is retained in this collection |
T |
set(int index,
T 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 |
|---|
protected List<ListDataListener> listDataListeners
| Constructor Detail |
|---|
public ArrayListModel()
public ArrayListModel(Collection<T> c)
public ArrayListModel(int initialCapacity)
| Method Detail |
|---|
public void add(int index,
T element)
add in interface List<T>add in class ArrayList<T>index - intobj - Objectpublic boolean add(T o)
add in interface Collection<T>add in interface List<T>add in class ArrayList<T>o - E
Collection.add())public boolean addAll(Collection<? extends T> coll)
addAll in interface Collection<T>addAll in interface List<T>addAll in class ArrayList<T>coll - Collection
public void clear()
clear in interface Collection<T>clear in interface List<T>clear in class ArrayList<T>public T remove(int index)
remove in interface List<T>remove in class ArrayList<T>index - int
public boolean remove(Object obj)
remove(index) method so the appropriate event can be fired.
remove in interface Collection<T>remove in interface List<T>remove in class ArrayList<T>obj - Object
public void removeRange(int fromIndex,
int toIndex)
removeRange in class ArrayList<T>fromIndex - inttoIndex - intpublic boolean removeAll(Collection<?> coll)
removeAll in interface Collection<T>removeAll in interface List<T>removeAll in class AbstractCollection<T>coll - Collection
public boolean retainAll(Collection<?> c)
retainAll in interface Collection<T>retainAll in interface List<T>retainAll in class AbstractCollection<T>coll - Collectionboolean - true if successful
public T set(int index,
T element)
set in interface List<T>set in class ArrayList<T>index - intelement - Objectpublic int getSize()
getSize in interface ListModelListModel.getSize()public Object getElementAt(int index)
getElementAt in interface ListModelindex - int
ListModel.getElementAt(int)public void addListDataListener(ListDataListener listener)
addListDataListener in interface ListModellistener - ListDataListenerListModel.addListDataListener(javax.swing.event.ListDataListener)public void removeListDataListener(ListDataListener listener)
removeListDataListener in interface 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 - intpublic List<T> getSelectedValues(int[] selectedIndices)
public List<T> getSelectedValues(JList jlist)
jlist -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||