displayablecollections
Interface DisplayableList<E>

All Superinterfaces:
java.util.Collection<E>, DisplayableCollection<E>, java.lang.Iterable<E>, java.util.List<E>
All Known Implementing Classes:
DisplayableArrayList, DisplayableLinkedList

public interface DisplayableList<E>
extends DisplayableCollection<E>, java.util.List<E>

A DisplayableList encapsulates a List and allows it to be displayed by a JList


Nested Class Summary
static interface DisplayableList.ListChangedNotification<E>
          An object that implements this interface encapsulates information about changes to an DisplayableList.
 
Nested classes/interfaces inherited from interface displayablecollections.DisplayableCollection
DisplayableCollection.CollectionChangedNotification<E>
 
Method Summary
 javax.swing.ListModel orderedListModel()
          Create a list model for displaying this collection in a JList.
 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.
 
Methods inherited from interface displayablecollections.DisplayableCollection
addObserver, deleteObservers, listModel
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, toArray, toArray
 

Method Detail

orderedListModel

javax.swing.ListModel orderedListModel()
Create a list model for displaying this collection in a JList. The result of calling toString() 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.


subList

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. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

The list returned by this method implements the DisplayableList interface to support enabling this list to notify its observers of changes made through the subList; but the subList itself cannot have observers of its own. Attempting to add an observer to the subList will result in an UnsupportedOperation exception.

Specified by:
subList in interface java.util.List<E>
Parameters:
fromIndex - low endpoint (inclusive) of the subList
toIndex - high endpoint (exclusive) of the subList