|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zul.AbstractListModel<Map.Entry<K,V>>
org.zkoss.zul.ListModelMap<K,V>
public class ListModelMap<K,V>
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 |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected Map<K,V> |
_map
|
Constructor Summary | |
---|---|
ListModelMap()
Constructor. |
|
ListModelMap(int initialCapacity)
Constructor. |
|
ListModelMap(int initialCapacity,
float loadFactor)
Constructor. |
|
ListModelMap(Map<? extends K,? extends V> map)
Constructor. |
|
ListModelMap(Map<K,V> map,
boolean live)
Constructor. |
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
|
boolean |
equals(Object o)
|
V |
get(Object key)
|
Map.Entry<K,V> |
getElementAt(int j)
Returns the entry (Map.Entry) at the specified index. |
Map<K,V> |
getInnerMap()
Get the inner real Map. |
int |
getSize()
Returns the length of the list. |
int |
hashCode()
|
int |
indexOf(Object o)
Returns the index of the specified object based on the entry (Map.Entry). |
int |
indexOfKey(Object o)
Returns the index of the specified object based on the key. |
boolean |
isEmpty()
|
Set<K> |
keySet()
|
V |
put(K key,
V o)
|
void |
putAll(Map<? extends K,? extends V> c)
|
V |
remove(Object key)
|
int |
size()
|
void |
sort(Comparator<Map.Entry<K,V>> cmpr,
boolean ascending)
Sorts the data. |
String |
toString()
|
Collection<V> |
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 Map<K,V> _map
Constructor Detail |
---|
public ListModelMap(Map<K,V> 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(Map<? extends K,? extends V> 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 Map<K,V> getInnerMap()
public int getSize()
ListModel
getSize
in interface ListModel<Map.Entry<K,V>>
public Map.Entry<K,V> getElementAt(int j)
getElementAt
in interface ListModel<Map.Entry<K,V>>
public void clear()
clear
in interface Map<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K,V>
public boolean equals(Object o)
equals
in interface Map<K,V>
equals
in class Object
public String toString()
toString
in class Object
public V get(Object key)
get
in interface Map<K,V>
public int hashCode()
hashCode
in interface Map<K,V>
hashCode
in class Object
public boolean isEmpty()
isEmpty
in interface Map<K,V>
public Set<K> keySet()
keySet
in interface Map<K,V>
public V put(K key, V o)
put
in interface Map<K,V>
public int indexOfKey(Object o)
o
- the key to look forpublic int indexOf(Object o)
o
- the object to look for. It must be an instance of Map.Entry.public void putAll(Map<? extends K,? extends V> c)
putAll
in interface Map<K,V>
public V remove(Object key)
remove
in interface Map<K,V>
public int size()
size
in interface Map<K,V>
public Collection<V> values()
values
in interface Map<K,V>
public void sort(Comparator<Map.Entry<K,V>> cmpr, boolean ascending)
sort
in interface Sortable<Map.Entry<K,V>>
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 |