public interface IListModel<E>
extends javax.swing.ListModel
This is the interface of a list model. This one is different from that in the swing framework. It allows also to add elements to the model and to remove them. Also you can get the size of the list and query if it is empty. But mostly there are methods for adding and removing elements which are not realized in the swing interface of javax.swing.ListModel.
Aside it also allows to set or delete the listener method for data
notification, called addListDataListener(ListDataListener)
and
removeListDataListener(ListDataListener)
. Both methods have the
same signature as the swing ones.
Modifier and Type | Method and Description |
---|---|
void |
add(int index_,
E element_)
Adds an element at the index to the list.
|
void |
addElement(E element_)
Adds an element to the end of the list.
|
void |
addListDataListener(javax.swing.event.ListDataListener listener_)
Adds a new ListDataListener to the model.
|
void |
clear()
Clears all element from the list.
|
boolean |
contains(E element_)
Queries if the corresponding element is in the model (true) or
not (false).
|
E |
get(int index)
Gets the current element at the position of index.
|
boolean |
isEmpty()
Queries if the list is empty.
|
boolean |
remove(E element_)
Removes the element from the model.
|
E |
remove(int index_)
Removes element at the position of index and returns the deleted element.
|
void |
removeListDataListener(javax.swing.event.ListDataListener listener_)
Removes a new ListDataListener from the model.
|
int |
size()
Returns the size of the model.
|
void add(int index_, E element_)
index_
- The index to add the element.element_
- The element to add to the model.void addElement(E element_)
element_
- The element to add to the model.void clear()
boolean contains(E element_)
element_
- Is the element to query for.E get(int index)
index
- Is the index. Should be in the range of the model indexes.
If it is outside a IllegalArgumentException will be thrown
or a null value is returned.int size()
boolean isEmpty()
boolean remove(E element_)
element_
- The element to be deleted.E remove(int index_)
index_
- The index in the model.void addListDataListener(javax.swing.event.ListDataListener listener_)
addListDataListener
in interface javax.swing.ListModel
listener_
- A ListDataListenervoid removeListDataListener(javax.swing.event.ListDataListener listener_)
removeListDataListener
in interface javax.swing.ListModel
listener_
- A ListDataListener14-September-2016 18:23 Deutsches Elektronen-Synchrotron DESY in der Helmholtz-Gemeinschaft