|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
displayablecollections.DisplayableTreeSet<E>
public class DisplayableTreeSet<E>
A DisplayableTreeSet encapsulates a TreeSet and allows it to be displayed by a JList
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface displayablecollections.DisplayableCollection |
---|
DisplayableCollection.CollectionChangedNotification<E> |
Constructor Summary | |
---|---|
DisplayableTreeSet()
Constructs a new empty set |
|
DisplayableTreeSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection, sorted according to the element's natural order |
|
DisplayableTreeSet(java.util.Comparator<? super E> c)
Constructs a new empty set according to the specified comparator |
|
DisplayableTreeSet(java.util.SortedSet<E> s)
Constructs a new set containing the same elements as the specified set, sorted according to the same ordering |
Method Summary | ||
---|---|---|
boolean |
add(E o)
|
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
|
void |
clear()
|
|
java.util.Comparator<? super E> |
comparator()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
equals(java.lang.Object o)
|
|
E |
first()
|
|
int |
hashCode()
|
|
java.util.SortedSet<E> |
headSet(E toElement)
Returns a view of the portion of this sorted set whose elements are strictly less than toElement. |
|
boolean |
isEmpty()
|
|
java.util.Iterator<E> |
iterator()
|
|
E |
last()
|
|
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. |
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
int |
size()
|
|
java.util.SortedSet<E> |
subSet(E fromElement,
E toElement)
Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive. |
|
java.util.SortedSet<E> |
tailSet(E fromElement)
Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement. |
|
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.Set |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public DisplayableTreeSet()
public DisplayableTreeSet(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed in the setpublic DisplayableTreeSet(java.util.Comparator<? super E> c)
c
- the comparatorpublic DisplayableTreeSet(java.util.SortedSet<E> s)
s
- the set whose elements are to be placed in the setMethod Detail |
---|
public javax.swing.ListModel orderedListModel()
DisplayableSortedSet
toString()
is what will actually be
displayed for each. The display will show the elements in the same
order as they appear in in the set.
orderedListModel
in interface DisplayableSortedSet<E>
public java.util.Comparator<? super E> comparator()
comparator
in interface java.util.SortedSet<E>
public E first()
first
in interface java.util.SortedSet<E>
public java.util.SortedSet<E> headSet(E toElement)
DisplayableSortedSet
headSet
in interface DisplayableSortedSet<E>
headSet
in interface java.util.SortedSet<E>
toElement
- - high endpoint (exclusive) of the headSet.
public E last()
last
in interface java.util.SortedSet<E>
public java.util.SortedSet<E> subSet(E fromElement, E toElement)
DisplayableSortedSet
subSet
in interface DisplayableSortedSet<E>
subSet
in interface java.util.SortedSet<E>
fromElement
- - low endpoint (inclusive) of the subSet.toElement
- - high endpoint (exclusive) of the subSeet.
public java.util.SortedSet<E> tailSet(E fromElement)
DisplayableSortedSet
tailSet
in interface DisplayableSortedSet<E>
tailSet
in interface java.util.SortedSet<E>
fromElement
- - low endpoint (inclusive) of the tailSet.
public javax.swing.ListModel listModel()
DisplayableCollection
toString()
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 DisplayableSortedSet
public boolean add(E o)
add
in interface java.util.Collection<E>
public 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.Object
public int hashCode()
hashCode
in interface java.util.Collection<E>
hashCode
in class java.lang.Object
public 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 remove(java.lang.Object o)
remove
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 |