|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
displayablecollections.DisplayableArrayList<E>
public class DisplayableArrayList<E>
A DisplayableArrayList encapsulates an ArrayList and allows it to be displayed by a JList
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface displayablecollections.DisplayableList |
|---|
DisplayableList.ListChangedNotification<E> |
| Nested classes/interfaces inherited from interface displayablecollections.DisplayableCollection |
|---|
DisplayableCollection.CollectionChangedNotification<E> |
| Constructor Summary | |
|---|---|
DisplayableArrayList()
Constructs a new empty list |
|
DisplayableArrayList(java.util.Collection<? extends E> c)
Constructs a new list containing the elements in the specified collection |
|
DisplayableArrayList(int initialCapacity)
Constructs a new empty list with the specified initial capacity |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E o)
|
|
void |
add(int index,
E element)
|
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
|
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
equals(java.lang.Object o)
|
|
E |
get(int index)
|
|
int |
hashCode()
|
|
int |
indexOf(java.lang.Object o)
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<E> |
iterator()
|
|
int |
lastIndexOf(java.lang.Object o)
|
|
java.util.ListIterator<E> |
listIterator()
|
|
java.util.ListIterator<E> |
listIterator(int index)
|
|
javax.swing.ListModel |
listModel()
Create a list model for displaying this collection in a JList. |
|
javax.swing.ListModel |
orderedListModel()
Create a list model for displaying this collection in a JList. |
|
E |
remove(int index)
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
E |
set(int index,
E element)
|
|
int |
size()
|
|
java.util.List<E> |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface displayablecollections.DisplayableCollection |
|---|
addObserver, deleteObservers, listModel |
| Methods inherited from interface java.util.List |
|---|
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
|---|
public DisplayableArrayList()
public DisplayableArrayList(java.util.Collection<? extends E> c)
c - the collection whose elements are to be placed in the listpublic DisplayableArrayList(int initialCapacity)
initialCapacity - the initial capacity| Method Detail |
|---|
public javax.swing.ListModel orderedListModel()
DisplayableListtoString() is what will actually be
displayed for each element. The display will show the elements in the same
order as they appear in in the list, including the possibility of
displaying duplicates.
orderedListModel in interface DisplayableList<E>public boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.List<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>
public void add(int index,
E element)
add in interface java.util.List<E>
public boolean addAll(int index,
java.util.Collection<? extends E> c)
addAll in interface java.util.List<E>public E get(int index)
get in interface java.util.List<E>public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<E>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<E>public java.util.ListIterator<E> listIterator()
listIterator in interface java.util.List<E>public java.util.ListIterator<E> listIterator(int index)
listIterator in interface java.util.List<E>public E remove(int index)
remove in interface java.util.List<E>
public E set(int index,
E element)
set in interface java.util.List<E>
public java.util.List<E> subList(int fromIndex,
int toIndex)
DisplayableList
subList in interface DisplayableList<E>subList in interface java.util.List<E>fromIndex - low endpoint (inclusive) of the subListtoIndex - high endpoint (exclusive) of the subListpublic javax.swing.ListModel listModel()
DisplayableCollectiontoString() is what will actually be
displayed for each element. There will be no necessary connection between
the order of display and any order in the collection, since this
method can be invoked on any collection implementing this interface.
(For collections having an inherent order, orderedListModel
can be used instead.)
listModel in interface DisplayableCollection<E>orderedListModel() in DisplayableList
and DisplayableSortedSetpublic boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>public void clear()
clear in interface java.util.Collection<E>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<E>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<E>hashCode in class java.lang.Objectpublic boolean isEmpty()
isEmpty in interface java.util.Collection<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>public int size()
size in interface java.util.Collection<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||