|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
jgnash.ui.components.SortedListModel<E>
public class SortedListModel<E extends java.lang.Comparable<? super E>>
A Sorted list model
| Field Summary | |
|---|---|
private java.util.List<E> |
list
|
private static long |
serialVersionUID
|
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
SortedListModel()
|
|
SortedListModel(java.util.Collection<E> list)
|
|
| Method Summary | |
|---|---|
(package private) void |
add(java.util.Collection<E> aList)
Add a list of objects, does not fire a notification |
void |
addElement(E obj)
Adds the specified component to the end of this list. |
java.util.List<E> |
asList()
Returns a copy of the list |
void |
clear()
Removes all of the elements from this list. |
boolean |
contains(E elem)
Tests if the specified object is a component in this list. |
void |
fireContentsChanged()
Resorts the list and fires a notification |
E |
get(int index)
|
E |
getElementAt(int index)
Returns the component at the specified index. |
int |
getSize()
Returns the number of components in this list. |
(package private) int |
indexOf(java.lang.Object elem)
Searches for the first occurrence of the given argument. |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
removeElement(java.lang.Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this list. |
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this list in the correct order. |
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private final java.util.List<E extends java.lang.Comparable<? super E>> list
| Constructor Detail |
|---|
public SortedListModel()
public SortedListModel(java.util.Collection<E> list)
| Method Detail |
|---|
public int getSize()
ArrayList.size()public E getElementAt(int index)
Note: Although this method is not deprecated, the preferred method to use is get(int), which implements the List interface defined in the 1.2 Collections framework.
index - an index into this list.
java.lang.ArrayIndexOutOfBoundsException - if the index is negative or not less than the current size of this list given.ArrayList.get(int)public E get(int index)
index - index for the object
ArrayList.get(int)void add(java.util.Collection<E> aList)
aList - collection of objects to addpublic boolean contains(E elem)
elem - an object.
true if the specified object
is the same as a component in this listVector.contains(Object)int indexOf(java.lang.Object elem)
elem - an object.
-1 if the object is not found.Vector.indexOf(Object)public void addElement(E obj)
obj - the component to be added.Vector.addElement(Object)public boolean removeElement(java.lang.Object obj)
obj - the component to be removed.
true if the argument was a component of this
list; false otherwise.ArrayList.remove(Object)public java.lang.Object[] toArray()
ArrayList.toArray()public java.util.List<E> asList()
public java.lang.Object remove(int index)
index - the index of the element to removed.
public void clear()
public void fireContentsChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||