|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zul.AbstractListModel<E>
org.zkoss.zul.ListModelSet<E>
public class ListModelSet<E>
This is the ListModel
as a Set
to be used with Listbox
.
Add or remove the contents of this model as a Set would cause the associated Listbox to change accordingly.
ListModel
,
ListModelList
,
ListModelMap
,
Serialized FormField Summary | |
---|---|
protected Set<E> |
_set
|
Constructor Summary | |
---|---|
ListModelSet()
Constructor. |
|
ListModelSet(Collection<? extends E> c)
Constructor. |
|
ListModelSet(E[] array)
Constructor. |
|
ListModelSet(int initialCapacity)
Constructor. |
|
ListModelSet(int initialCapacity,
float loadFactor)
Constructor. |
|
ListModelSet(Set<E> set,
boolean live)
Constructor |
Method Summary | ||
---|---|---|
boolean |
add(E o)
This implementation optimized on the LinkedHashSet(which guaratee the sequence of the added item). |
|
boolean |
addAll(Collection<? extends E> c)
This implementation optimized on the LinkedHashSet(which guaratee the sequence of the added item). |
|
void |
clear()
|
|
boolean |
contains(Object elem)
|
|
boolean |
containsAll(Collection c)
|
|
boolean |
equals(Object o)
|
|
E |
getElementAt(int j)
Returns the value at the specified index. |
|
Set<E> |
getInnerSet()
Get the inner real set. |
|
int |
getSize()
Returns the length of the list. |
|
int |
hashCode()
|
|
int |
indexOf(Object o)
Returns the index of the specified object, or -1 if not found. |
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(Collection<?> c)
|
|
boolean |
retainAll(Collection<?> c)
|
|
int |
size()
|
|
void |
sort(Comparator<E> cmpr,
boolean ascending)
Sorts the data. |
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
String |
toString()
|
Methods inherited from class org.zkoss.zul.AbstractListModel |
---|
addListDataListener, addSelection, clearSelection, fireEvent, getSelection, removeAllSelection, removeListDataListener, removeSelection, retainAllSelection |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Set<E> _set
Constructor Detail |
---|
public ListModelSet(Set<E> set, boolean live)
set
- the set to representlive
- whether to have a 'live' ListModel
on top of
the specified set.
If false, the content of the specified set is copied.
If true, this object is a 'facade' of the specified set,
i.e., when you add or remove items from this ListModelSet
,
the inner "live" set would be changed accordingly.
However, it is not a good idea to modify set
if it is passed to this method with live is true,
since Listbox
is not smart enough to hanle it.
Instead, modify it thru this object.public ListModelSet()
public ListModelSet(Collection<? extends E> c)
public ListModelSet(E[] array)
public ListModelSet(int initialCapacity)
initialCapacity
- the initial capacity for this ListModelSet.public ListModelSet(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity for this ListModelMap.loadFactor
- the loadFactor to increase capacity of this ListModelMap.Method Detail |
---|
public Set<E> getInnerSet()
public int getSize()
ListModel
getSize
in interface ListModel<E>
public E getElementAt(int j)
ListModel
getElementAt
in interface ListModel<E>
public boolean add(E o)
add
in interface Collection<E>
add
in interface Set<E>
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in interface Set<E>
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
public boolean contains(Object elem)
contains
in interface Collection<E>
contains
in interface Set<E>
public boolean containsAll(Collection c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in interface Set<E>
equals
in class Object
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in interface Set<E>
hashCode
in class Object
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
public String toString()
toString
in class Object
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in interface Set<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
public int indexOf(Object o)
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
public int size()
size
in interface Collection<E>
size
in interface Set<E>
public Object[] toArray()
toArray
in interface Collection<E>
toArray
in interface Set<E>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
toArray
in interface Set<E>
public void sort(Comparator<E> cmpr, boolean ascending)
sort
in interface Sortable<E>
cmpr
- the comparator.ascending
- whether to sort in the ascending order.
It is ignored since this implementation uses cmprt to compare.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |