|
||||||||||
| 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.ListModelArray<E>
public class ListModelArray<E>
This is the ListModel as an Object array to be used with Listbox.
Change the contents of this model as an Object array would cause the associated Listbox to
change accordingly.
ListModel,
ListModelList,
ListModelMap,
Serialized Form| Field Summary | |
|---|---|
protected java.lang.Object[] |
_array
|
| Constructor Summary | |
|---|---|
ListModelArray(E[] src)
Constructor. |
|
ListModelArray(E[] array,
boolean live)
Constructor |
|
ListModelArray(int size)
Constructor. |
|
ListModelArray(java.util.List<? extends E> list)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
E |
get(int index)
Get the value of this ListModelArray at specified index. |
E |
getElementAt(int j)
Returns the value at the specified index. |
java.lang.Object[] |
getInnerArray()
Get the inner real Object[]. |
int |
getSize()
Returns the length of the list. |
int |
hashCode()
|
int |
indexOf(java.lang.Object elm)
Returns the index of the specified element. |
void |
set(int index,
E value)
Change content of the Array at specified index. |
void |
sort(java.util.Comparator<E> cmpr,
boolean ascending)
Sorts the data. |
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 final java.lang.Object[] _array
| Constructor Detail |
|---|
public ListModelArray(E[] array,
boolean live)
array - the array to representlive - whether to have a 'live' ListModel on top of
the specified array.
If false, the content of the specified array is copied.
If true, this object is a 'facade' of the specified array,
i.e., when you add or remove items from this ListModelArray,
the inner "live" array would be changed accordingly.
However, it is not a good idea to modify array
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 ListModelArray(E[] src)
src - the source array used to initialize this ListModelArray.public ListModelArray(int size)
size - the array size.public ListModelArray(java.util.List<? extends E> list)
| Method Detail |
|---|
public E get(int index)
index - the array index to be get value.
public void set(int index,
E value)
index - the array index to be set the new value.public java.lang.Object[] getInnerArray()
public int indexOf(java.lang.Object elm)
public int getSize()
ListModel
getSize in interface ListModel<E>public E getElementAt(int j)
ListModel
getElementAt in interface ListModel<E>
public void sort(java.util.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.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||