|
||||||||||
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.ListModelArray
public class ListModelArray
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 FormField Summary | |
---|---|
protected java.lang.Object[] |
_array
|
Constructor Summary | |
---|---|
ListModelArray(int size)
Constructor. |
|
ListModelArray(java.util.List list)
Constructor. |
|
ListModelArray(java.lang.Object[] src)
Constructor. |
|
ListModelArray(java.lang.Object[] array,
boolean live)
Constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(int index)
Get the value of this ListModelArray at specified index. |
java.lang.Object |
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,
java.lang.Object value)
Change content of the Array at specified index. |
void |
sort(java.util.Comparator 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(java.lang.Object[] 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(java.lang.Object[] src)
src
- the source array used to initialize this ListModelArray.public ListModelArray(int size)
size
- the array size.public ListModelArray(java.util.List list)
Method Detail |
---|
public java.lang.Object get(int index)
index
- the array index to be get value.public void set(int index, java.lang.Object 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
public java.lang.Object getElementAt(int j)
ListModel
getElementAt
in interface ListModel
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.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public 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 |