| de.odysseus.calyxo.forms.view.ListModel
All known Subclasses: de.odysseus.calyxo.forms.view.DefaultListModel,
ListModel | public interface ListModel (Code) | | List model interface.
A list model defines a bijection between string keys and object values.
That is, each key corresponds to exacly one value and vice versa.
Keys must not be null or empty. Values must not be null .
The interface provides a method to lookup labels and to get all values
in some sorted order. The interface defines some keys for common
sort criteria. Generally, an implementation must support the
INDEX_ORDER order. If an implementation does not
support some other requested order, it should answer the values in
INDEX_ORDER instead.
author: Oliver Stuhr author: Christoph Beck |
Method Summary | |
public boolean | containsKey(String key) Answer true iff the specified key is valid. | public String | getKey(Object value) Get the corresponding key for the specified value. | public String | getLabel(Object value, Locale locale) Lookup the label used for display purposes for the specified
value. | public int | getSize() Get the number of values in this model. | public Object | getValue(int index) Get the value for specified index (according to index order). | public Object | getValue(String key) Get the corresponding value for the specified key. | public Iterator | getValues() Iterate over values (in no particular order). | public Iterator | getValues(int order, boolean descending, Locale locale) Get the values sorted according to the specified order. |
INDEX_ORDER | final public static int INDEX_ORDER(Code) | | Index order. This order refers to the model's internal order.
For example, it may reflect the order, values have been added.
to the model. The sorted sequence contains
getValue(0), ..., getValue(getSize()-1) .
|
KEY_ORDER | final public static int KEY_ORDER(Code) | | Key order. Lexicographical order of the keys.
|
LABEL_ORDER | final public static int LABEL_ORDER(Code) | | Label order. Lexicographical order of the labels.
|
VALUE_ORDER | final public static int VALUE_ORDER(Code) | | Value order. Some order defined on the values.
Implementation-dependent.
|
containsKey | public boolean containsKey(String key)(Code) | | Answer true iff the specified key is valid.
The result of this method is equivalent to
key == getKey(getValue(key)) .
|
getKey | public String getKey(Object value)(Code) | | Get the corresponding key for the specified value. If the
value is not contained in the model, answer null .
Because valid keys must not be null , this indicates
an invalid value.
|
getLabel | public String getLabel(Object value, Locale locale)(Code) | | Lookup the label used for display purposes for the specified
value. The passed locale parameter may be used
to lookup a localized label.
|
getSize | public int getSize()(Code) | | Get the number of values in this model.
|
getValue | public Object getValue(int index)(Code) | | Get the value for specified index (according to index order).
|
getValue | public Object getValue(String key)(Code) | | Get the corresponding value for the specified key. If the key
is not contained in the model, answer null .
|
getValues | public Iterator getValues()(Code) | | Iterate over values (in no particular order).
|
getValues | public Iterator getValues(int order, boolean descending, Locale locale)(Code) | | Get the values sorted according to the specified order.
In case of order == LABEL_ORDER , the passed
locale parameter may be used to lookup localized
labels.
|
|
|