M - The class of the model object.public class ListModel<M> extends Object implements IListModel<M>
IListModel.IListModelListener, IListModel.ListEventType| Constructor and Description |
|---|
ListModel() |
ListModel(Collection<M> list) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
M value) |
boolean |
add(M value) |
boolean |
addAll(Collection<? extends M> c) |
boolean |
addAll(int index,
Collection<? extends M> c) |
boolean |
addEventListener(IListModel.IListModelListener listener)
Register a listener to receive events when the list is modified.
|
void |
clear() |
boolean |
contains(Object value) |
boolean |
containsAll(Collection<?> c) |
M |
get(int index) |
int |
indexOf(Object value) |
boolean |
isEmpty() |
Iterator<M> |
iterator() |
int |
lastIndexOf(Object value) |
ListIterator<M> |
listIterator() |
ListIterator<M> |
listIterator(int index) |
M |
remove(int index) |
boolean |
remove(Object value) |
boolean |
removeAll(Collection<?> c) |
void |
removeAllListeners()
Removes all listeners.
|
boolean |
removeEventListener(IListModel.IListModelListener listener)
Removes a single event listener.
|
boolean |
removeRange(int start,
int end)
Removes a range of elements by index.
|
boolean |
retainAll(Collection<?> c) |
M |
set(int index,
M value) |
int |
size() |
void |
sort(Comparator<? super M> comparator,
boolean ascending)
Sorts the list given the comparator and the sort direction.
|
List<M> |
subList(int fromIndex,
int toIndex) |
void |
swap(int index1,
int index2)
Swap two list entries by index.
|
void |
swap(M item1,
M item2)
Swap two list entries.
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsortequals, hashCode, replaceAll, spliteratorparallelStream, removeIf, streampublic ListModel()
public ListModel(Collection<M> list)
public boolean add(M value)
public boolean addAll(Collection<? extends M> c)
public boolean addAll(int index,
Collection<? extends M> c)
public boolean addEventListener(IListModel.IListModelListener listener)
IListModeladdEventListener in interface IListModel<M>listener - The listener to add.public void clear()
public boolean contains(Object value)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<M>containsAll in interface List<M>public boolean isEmpty()
public int lastIndexOf(Object value)
lastIndexOf in interface List<M>public ListIterator<M> listIterator()
listIterator in interface List<M>public ListIterator<M> listIterator(int index)
listIterator in interface List<M>public boolean remove(Object value)
public boolean removeAll(Collection<?> c)
public boolean removeRange(int start,
int end)
IListModelremoveRange in interface IListModel<M>start - Start of range (inclusive).end - End of range (inclusive).public void removeAllListeners()
IListModelremoveAllListeners in interface IListModel<M>public boolean removeEventListener(IListModel.IListModelListener listener)
IListModelremoveEventListener in interface IListModel<M>listener - The listener to remove.public boolean retainAll(Collection<?> c)
public int size()
public void sort(Comparator<? super M> comparator, boolean ascending)
IListModelsort in interface IListModel<M>comparator - The comparator to use in sorting. If null, a comparator using the model
objects' native sort order will be applied.ascending - If true, sort list in ascending order; otherwise, in descending order.public void swap(int index1,
int index2)
IListModelswap in interface IListModel<M>index1 - Index of first entry.index2 - Index of second entry.public void swap(M item1, M item2)
IListModelswap in interface IListModel<M>item1 - The first entry.item2 - The second entry.public Object[] toArray()
Copyright © 2017 Regenstrief Center for Biomedical Informatics. All rights reserved.