displayablecollections
Class DisplayableLinkedHashSet<E>
java.lang.Object
java.util.Observable
displayablecollections.DisplayableHashSet<E>
displayablecollections.DisplayableLinkedHashSet<E>
- All Implemented Interfaces:
- DisplayableCollection<E>, DisplayableSet<E>, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>
public class DisplayableLinkedHashSet<E>
- extends DisplayableHashSet<E>
A DisplayableHashSet encapsulates a LinkedHashSet and allows it to be
displayed by a JList
- See Also:
- Serialized Form
Constructor Summary |
DisplayableLinkedHashSet()
Constructs a new empty set |
DisplayableLinkedHashSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection |
DisplayableLinkedHashSet(int initialCapacity)
Constructs a new empty set whose backing HashMap has the specified
initial capacity |
DisplayableLinkedHashSet(int initialCapacity,
float loadFactor)
Constructs a new empty set whose backing HashMap has the specified
initial capacity and load factor |
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 java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
DisplayableLinkedHashSet
public DisplayableLinkedHashSet()
- Constructs a new empty set
DisplayableLinkedHashSet
public DisplayableLinkedHashSet(java.util.Collection<? extends E> c)
- Constructs a new set containing the elements in the specified collection
- Parameters:
c
- the collection whose elements are to be placed in the set
DisplayableLinkedHashSet
public DisplayableLinkedHashSet(int initialCapacity)
- Constructs a new empty set whose backing HashMap has the specified
initial capacity
- Parameters:
initialCapacity
- the initial capacity
DisplayableLinkedHashSet
public DisplayableLinkedHashSet(int initialCapacity,
float loadFactor)
- Constructs a new empty set whose backing HashMap has the specified
initial capacity and load factor
- Parameters:
initialCapacity
- the initial capacityloadFactor
- the load factor
listModel
public javax.swing.ListModel listModel()
- Description copied from interface:
DisplayableCollection
- 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. 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.)
- Specified by:
listModel
in interface DisplayableCollection<E>
- See Also:
orderedListModel()
in DisplayableList
and DisplayableSortedSet
add
public boolean add(E o)
- Specified by:
add
in interface java.util.Collection<E>
addAll
public boolean addAll(java.util.Collection<? extends E> c)
- Specified by:
addAll
in interface java.util.Collection<E>
clear
public void clear()
- Specified by:
clear
in interface java.util.Collection<E>
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interface java.util.Collection<E>
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interface java.util.Collection<E>
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in interface java.util.Collection<E>
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Specified by:
hashCode
in interface java.util.Collection<E>
- Overrides:
hashCode
in class java.lang.Object
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Collection<E>
iterator
public java.util.Iterator<E> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<E>
- Specified by:
iterator
in interface java.util.Collection<E>
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interface java.util.Collection<E>
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interface java.util.Collection<E>
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interface java.util.Collection<E>
size
public int size()
- Specified by:
size
in interface java.util.Collection<E>
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interface java.util.Collection<E>
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interface java.util.Collection<E>