|
||||||||||
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.ListModelMap
public class ListModelMap
This is the ListModel
as a Map
to be used with Listbox
.
Add or remove the contents of this model as a List would cause the associated Listbox to change accordingly.
ListModel
,
ListModelList
,
ListModelMap
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Field Summary | |
---|---|
protected java.util.Map |
_map
|
Constructor Summary | |
---|---|
ListModelMap()
Constructor. |
|
ListModelMap(int initialCapacity)
Constructor. |
|
ListModelMap(int initialCapacity,
float loadFactor)
Constructor. |
|
ListModelMap(java.util.Map map)
Constructor. |
|
ListModelMap(java.util.Map map,
boolean live)
Constructor. |
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(java.lang.Object key)
|
java.lang.Object |
getElementAt(int j)
Returns the entry (Map.Entry) at the specified index. |
java.util.Map |
getInnerMap()
Get the inner real Map. |
int |
getSize()
Returns the length of the list. |
int |
hashCode()
|
int |
indexOf(java.lang.Object o)
Returns the index of the specified object based on the entry (Map.Entry). |
int |
indexOfKey(java.lang.Object o)
Returns the index of the specified object based on the key. |
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object o)
|
void |
putAll(java.util.Map c)
|
java.lang.Object |
remove(java.lang.Object key)
|
int |
size()
|
void |
sort(java.util.Comparator cmpr,
boolean ascending)
Sorts the data. |
java.lang.String |
toString()
|
java.util.Collection |
values()
|
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.Map _map
Constructor Detail |
---|
public ListModelMap(java.util.Map map, boolean live)
map
- the map to representlive
- whether to have a 'live' ListModel
on top of
the specified map.
If false, the content of the specified map is copied.
If true, this object is a 'facade' of the specified map,
i.e., when you add or remove items from this ListModelMap
,
the inner "live" map would be changed accordingly.
However, it is not a good idea to modify map
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 ListModelMap()
public ListModelMap(java.util.Map map)
public ListModelMap(int initialCapacity)
initialCapacity
- the initial capacity for this ListModelMap.public ListModelMap(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.Map getInnerMap()
public int getSize()
ListModel
getSize
in interface ListModel
public java.lang.Object getElementAt(int j)
getElementAt
in interface ListModel
public void clear()
clear
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
public int hashCode()
hashCode
in interface java.util.Map
hashCode
in class java.lang.Object
public boolean isEmpty()
isEmpty
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
public java.lang.Object put(java.lang.Object key, java.lang.Object o)
put
in interface java.util.Map
public int indexOfKey(java.lang.Object o)
o
- the key to look forpublic int indexOf(java.lang.Object o)
o
- the object to look for. It must be an instance of Map.Entry.public void putAll(java.util.Map c)
putAll
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public int size()
size
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
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 |