|
||||||||||
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.AbstractSequentialList<E>
java.util.LinkedList<E>
com.jgoodies.common.collect.LinkedListModel<E>
E
- the type of the list elementspublic class LinkedListModel<E>
Adds ListModel
capabilities to its superclass.
It allows to observe changes in the content and structure. Useful for
Lists that are bound to list views such as JList, JComboBox and JTable.
This class should be be final and it will be marked final in a future version, if its subclass in the JGoodies Binding has been removed.
ObservableList
,
ArrayListModel
,
Serialized FormField Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
LinkedListModel()
Constructs an empty LinkedListModel. |
|
LinkedListModel(java.util.Collection<? extends E> c)
Constructs a LinkedListModel containing the elements of the specified collection, in the order they are returned by the collection's iterator. |
Method Summary | |
---|---|
boolean |
add(E e)
|
void |
add(int index,
E element)
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
|
void |
addFirst(E e)
|
void |
addLast(E e)
|
void |
addListDataListener(javax.swing.event.ListDataListener l)
|
void |
clear()
|
void |
fireContentsChanged(int index)
Notifies all registered ListDataListeners that the element
at the specified index has changed. |
E |
getElementAt(int index)
|
javax.swing.event.ListDataListener[] |
getListDataListeners()
Returns an array of all the list data listeners registered on this LinkedListModel . |
int |
getSize()
|
java.util.ListIterator<E> |
listIterator(int index)
|
E |
remove(int index)
|
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection<?> c)
Removes from this collection all of its elements that are contained in the specified collection (optional operation). |
E |
removeFirst()
|
E |
removeLast()
|
void |
removeListDataListener(javax.swing.event.ListDataListener l)
|
protected void |
removeRange(int fromIndex,
int toIndex)
|
boolean |
retainAll(java.util.Collection<?> c)
Retains only the elements in this collection that are contained in the specified collection (optional operation). |
E |
set(int index,
E element)
|
Methods inherited from class java.util.LinkedList |
---|
addAll, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, removeFirstOccurrence, removeLastOccurrence, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, size, subList, toArray, toArray |
Methods inherited from interface java.util.Deque |
---|
iterator |
Constructor Detail |
---|
public LinkedListModel()
public LinkedListModel(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed into this list.
java.lang.NullPointerException
- if c
is null
Method Detail |
---|
public final void add(int index, E element)
add
in interface java.util.List<E>
add
in class java.util.LinkedList<E>
public final boolean add(E e)
add
in interface java.util.Collection<E>
add
in interface java.util.Deque<E>
add
in interface java.util.List<E>
add
in interface java.util.Queue<E>
add
in class java.util.LinkedList<E>
public final boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
addAll
in class java.util.LinkedList<E>
public boolean removeAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements in common with the specified collection.
removeAll
in interface java.util.Collection<E>
removeAll
in interface java.util.List<E>
removeAll
in class java.util.AbstractCollection<E>
c
- elements to be removed from this collection.
java.lang.UnsupportedOperationException
- if the removeAll method
is not supported by this collection.
java.lang.NullPointerException
- if the specified collection is null.remove(Object)
,
LinkedList.contains(Object)
public boolean retainAll(java.util.Collection<?> c)
This implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's not so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements not present in the specified collection.
retainAll
in interface java.util.Collection<E>
retainAll
in interface java.util.List<E>
retainAll
in class java.util.AbstractCollection<E>
c
- elements to be retained in this collection.
java.lang.UnsupportedOperationException
- if the retainAll method
is not supported by this Collection.
java.lang.NullPointerException
- if the specified collection is null.remove(Object)
,
LinkedList.contains(Object)
public final void addFirst(E e)
addFirst
in interface java.util.Deque<E>
addFirst
in class java.util.LinkedList<E>
public final void addLast(E e)
addLast
in interface java.util.Deque<E>
addLast
in class java.util.LinkedList<E>
public final void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.List<E>
clear
in class java.util.LinkedList<E>
public final E remove(int index)
remove
in interface java.util.List<E>
remove
in class java.util.LinkedList<E>
public final boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
remove
in interface java.util.Deque<E>
remove
in interface java.util.List<E>
remove
in class java.util.LinkedList<E>
public final E removeFirst()
removeFirst
in interface java.util.Deque<E>
removeFirst
in class java.util.LinkedList<E>
public final E removeLast()
removeLast
in interface java.util.Deque<E>
removeLast
in class java.util.LinkedList<E>
protected final void removeRange(int fromIndex, int toIndex)
removeRange
in class java.util.AbstractList<E>
public final E set(int index, E element)
set
in interface java.util.List<E>
set
in class java.util.LinkedList<E>
public final java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
listIterator
in class java.util.LinkedList<E>
public final void addListDataListener(javax.swing.event.ListDataListener l)
addListDataListener
in interface javax.swing.ListModel
public final void removeListDataListener(javax.swing.event.ListDataListener l)
removeListDataListener
in interface javax.swing.ListModel
public final E getElementAt(int index)
getElementAt
in interface javax.swing.ListModel
public final int getSize()
getSize
in interface javax.swing.ListModel
public final void fireContentsChanged(int index)
ListDataListeners
that the element
at the specified index has changed. Useful if there's a content change
without any structural change.This method must be called after the element of the list changes.
index
- the index of the element that has changedEventListenerList
public final javax.swing.event.ListDataListener[] getListDataListeners()
LinkedListModel
.
ListDataListener
s,
or an empty array if no list data listeners
are currently registeredaddListDataListener(ListDataListener)
,
removeListDataListener(ListDataListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |