|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zul.AbstractListModel
org.zkoss.zul.ListModelSet
public class ListModelSet
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 java.util.Set |
_set
|
Constructor Summary | |
---|---|
ListModelSet()
Constructor. |
|
ListModelSet(java.util.Collection c)
Constructor. |
|
ListModelSet(int initialCapacity)
Constructor. |
|
ListModelSet(int initialCapacity,
float loadFactor)
Constructor. |
|
ListModelSet(java.lang.Object[] array)
Constructor. |
|
ListModelSet(java.util.Set set,
boolean live)
Constructor |
Method Summary | |
---|---|
boolean |
add(java.lang.Object o)
This implementation optimized on the LinkedHashSet(which guaratee the sequence of the added item). |
boolean |
addAll(java.util.Collection c)
This implementation optimized on the LinkedHashSet(which guaratee the sequence of the added item). |
void |
clear()
|
boolean |
contains(java.lang.Object elem)
|
boolean |
containsAll(java.util.Collection c)
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
getElementAt(int j)
Returns the value at the specified index. |
java.util.Set |
getInnerSet()
Get the inner real set. |
int |
getSize()
Returns the length of the list. |
int |
hashCode()
|
int |
indexOf(java.lang.Object o)
Returns the index of the specified object, or -1 if not found. |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
int |
size()
|
void |
sort(java.util.Comparator cmpr,
boolean ascending)
Sorts the data. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
java.lang.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 java.util.Set _set
Constructor Detail |
---|
public ListModelSet(java.util.Set 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(java.util.Collection c)
public ListModelSet(java.lang.Object[] 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 java.util.Set getInnerSet()
public int getSize()
ListModel
getSize
in interface ListModel
public java.lang.Object getElementAt(int j)
ListModel
getElementAt
in interface ListModel
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.Set
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.Set
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.Set
public boolean contains(java.lang.Object elem)
contains
in interface java.util.Collection
contains
in interface java.util.Set
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.Set
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection
equals
in interface java.util.Set
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection
hashCode
in interface java.util.Set
hashCode
in class java.lang.Object
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.Set
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.Set
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.Set
public int indexOf(java.lang.Object o)
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.Set
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.Set
public int size()
size
in interface java.util.Collection
size
in interface java.util.Set
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
toArray
in interface java.util.Set
public void sort(java.util.Comparator cmpr, boolean ascending)
sort
in interface ListModelExt
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 |