public class ListWrapperListModel<E>
extends AbstractListModel
A ListModel implementation that's backed by a live List.
| Constructor and description |
|---|
ListWrapperListModel(List<E> delegateList)Creates a list model backed by the supplied live list. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
add(int i, E e)Inserts an element at the supplied index and notifies listeners. |
|
public boolean |
add(E e)Appends the supplied element to the backing list and notifies listeners. |
|
public boolean |
addAll(Collection<? extends E> es)Appends every element from the supplied collection and notifies listeners when anything was added. |
|
public boolean |
addAll(int i, Collection<? extends E> es)Inserts every element from the supplied collection at the supplied index. |
|
public void |
clear()Removes every element from the backing list and notifies listeners. |
|
public boolean |
contains(Object o)Returns whether the backing list contains the supplied element. |
|
public boolean |
containsAll(Collection<?> objects)Returns whether the backing list contains every supplied element. |
|
public E |
get(int i)Returns the element at the supplied index. |
|
public List<E> |
getDelegateList()Returns the live backing list. |
|
public Object |
getElementAt(int i)Returns the element at the supplied index from the backing list. |
|
public int |
getSize()Returns the number of elements currently exposed by the backing list. |
|
public int |
indexOf(Object o)Returns the first index of the supplied element in the backing list. |
|
public boolean |
isEmpty()Returns whether the backing list is empty. |
|
public Iterator<E> |
iterator()Returns an iterator over the backing list. |
|
public int |
lastIndexOf(Object o)Returns the last index of the supplied element in the backing list. |
|
public ListIterator<E> |
listIterator()Returns a list iterator over the backing list. |
|
public ListIterator<E> |
listIterator(int i)Returns a list iterator that starts at the supplied index. |
|
public E |
remove(int i)Removes the element at the supplied index and notifies listeners. |
|
public boolean |
remove(Object o)Removes the supplied element from the backing list and notifies listeners when it was present. |
|
public void |
removeRange(int fromIndex, int toIndex)Removes the inclusive index range from the backing list and notifies listeners. |
|
public E |
set(int i, E e)Replaces the element at the supplied index and fires a content-changed event. |
<T> |
public T[] |
toArray(T[] ts)Copies the backing list into the supplied destination array. |
|
public Object[] |
toArray()Copies the backing list into a new object array. |
| Methods inherited from class | Name |
|---|---|
class AbstractListModel |
addListDataListener, equals, getClass, getElementAt, getListDataListeners, getListeners, getSize, hashCode, notify, notifyAll, removeListDataListener, toString, wait, wait, wait |
Creates a list model backed by the supplied live list.
delegateList - the backing listInserts an element at the supplied index and notifies listeners.
i - the insertion indexe - the element to insertAppends the supplied element to the backing list and notifies listeners.
e - the element to appendtrue when the backing list changedAppends every element from the supplied collection and notifies listeners when anything was added.
es - the elements to appendtrue when the backing list changedInserts every element from the supplied collection at the supplied index.
i - the insertion indexes - the elements to inserttrue when the backing list changedRemoves every element from the backing list and notifies listeners.
Returns whether the backing list contains the supplied element.
o - the element to search fortrue when the element is presentReturns whether the backing list contains every supplied element.
objects - the elements to testtrue when every element is presentReturns the element at the supplied index.
i - the element indexReturns the live backing list.
Returns the element at the supplied index from the backing list.
i - the requested element indexiReturns the number of elements currently exposed by the backing list.
Returns the first index of the supplied element in the backing list.
o - the element to search for-1Returns whether the backing list is empty.
true when the model contains no elementsReturns an iterator over the backing list.
Returns the last index of the supplied element in the backing list.
o - the element to search for-1Returns a list iterator over the backing list.
Returns a list iterator that starts at the supplied index.
i - the starting indexRemoves the element at the supplied index and notifies listeners.
i - the element indexRemoves the supplied element from the backing list and notifies listeners when it was present.
o - the element to removetrue when the backing list changedRemoves the inclusive index range from the backing list and notifies listeners.
fromIndex - the first index to removetoIndex - the last index to removeReplaces the element at the supplied index and fires a content-changed event.
i - the element indexe - the replacement elementCopies the backing list into the supplied destination array.
ts - the destination arrayT - the array component typeCopies the backing list into a new object array.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.