org.springframework.binding.value.support
Class ListListModel
java.lang.Object
javax.swing.AbstractListModel
org.springframework.binding.value.support.ListListModel
- All Implemented Interfaces:
- Serializable, Iterable, Collection, List, ListModel, ObservableList
- Direct Known Subclasses:
- ComboBoxListModel, DynamicListModel
public class ListListModel
- extends AbstractListModel
- implements ObservableList
- Author:
- Keith Donald
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListListModel
public ListListModel()
ListListModel
public ListListModel(List items)
ListListModel
public ListListModel(List items,
Comparator sorter)
setComparator
public void setComparator(Comparator sorter)
sort
public void sort()
getItems
protected List getItems()
getSize
public int getSize()
- Specified by:
getSize
in interface ListModel
getElementAt
public Object getElementAt(int index)
- Specified by:
getElementAt
in interface ListModel
add
public void add(int index,
Object o)
- Specified by:
add
in interface List
getIndexAdapter
public IndexAdapter getIndexAdapter(int index)
- Specified by:
getIndexAdapter
in interface ObservableList
add
public boolean add(Object o)
- Specified by:
add
in interface Collection
- Specified by:
add
in interface List
addAll
public boolean addAll(Collection c)
- Specified by:
addAll
in interface Collection
- Specified by:
addAll
in interface List
addAll
public boolean addAll(int index,
Collection c)
- Specified by:
addAll
in interface List
clear
public void clear()
- Specified by:
clear
in interface Collection
- Specified by:
clear
in interface List
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection
- Specified by:
contains
in interface List
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll
in interface Collection
- Specified by:
containsAll
in interface List
get
public Object get(int index)
- Specified by:
get
in interface List
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interface List
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Collection
- Specified by:
isEmpty
in interface List
iterator
public Iterator iterator()
- Specified by:
iterator
in interface Iterable
- Specified by:
iterator
in interface Collection
- Specified by:
iterator
in interface List
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interface List
listIterator
public ListIterator listIterator()
- Specified by:
listIterator
in interface List
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator
in interface List
remove
public Object remove(int index)
- Specified by:
remove
in interface List
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection
- Specified by:
remove
in interface List
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAll
in interface Collection
- Specified by:
removeAll
in interface List
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAll
in interface Collection
- Specified by:
retainAll
in interface List
set
public Object set(int index,
Object element)
- Set the value of a list element at the specified index.
- Specified by:
set
in interface List
- Parameters:
index
- of element to setelement
- New element value
- Returns:
- old element value
hasChanged
protected boolean hasChanged(Object oldElement,
Object newElement)
- Determine if the provided objects are different (have changed). This method essentially
embodies the "change semantics" for elements in this list. If list elements have an
altered "equals" implementation, it may not be sufficient to detect changes in a pair of
objects. In that case, you can override this method and implement whatever change detection
mechanism is appropriate.
- Parameters:
oldElement
- Old (original) value to comparenewElement
- New (updated) value to compare
- Returns:
- true if objects are different (have changed)
size
public int size()
- Specified by:
size
in interface Collection
- Specified by:
size
in interface List
subList
public List subList(int fromIndex,
int toIndex)
- Specified by:
subList
in interface List
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Collection
- Specified by:
toArray
in interface List
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArray
in interface Collection
- Specified by:
toArray
in interface List
fireContentsChanged
protected void fireContentsChanged(int index)
- Notifies the list model that one of the list elements has changed.
fireContentsChanged
protected void fireContentsChanged(int startIndex,
int endIndex)
- Notifies the list model that one or more of the list elements have
changed. The changed elements are specified by the range startIndex to
endIndex inclusive.
replaceWith
public boolean replaceWith(Collection collection)
- Replace this list model's items with the contents of the provided
collection.
- Parameters:
collection
- The collection to replace with
Copyright © 2004-2008 The Spring Framework. All Rights Reserved.