org.mentawai.list
Interface ListData

All Known Implementing Classes:
BaseListData, DBListData, I18nListData, LocalizedListData, SimpleListData

public interface ListData

Defines how a data list works.

Author:
Sergio Oliveira

Method Summary
 java.lang.String getName()
          Returns the name of this list.
 java.lang.String getValue(int id, java.util.Locale loc)
          Returns the string value of the list data item with the given id in the given locale.
 java.lang.String getValue(java.lang.String id)
          Returns the strign value fo the list data item with the default locale.
 java.lang.String getValue(java.lang.String id, java.util.Locale loc)
          Returns the string value of the list data item with the given id in the given locale.
 java.util.List<ListItem> getValues()
          Returns a list of ListItem for the default locale.
 java.util.List<ListItem> getValues(java.util.Locale loc)
          Returns a list of ListItem in the given locale.
 int size()
          Returns the size of this list.
 

Method Detail

getValue

java.lang.String getValue(java.lang.String id,
                          java.util.Locale loc)
Returns the string value of the list data item with the given id in the given locale.

Parameters:
id - The id of the list data item.
loc - The locale of the list data item.
Returns:
The string value for the list data item.

getValue

java.lang.String getValue(java.lang.String id)
Returns the strign value fo the list data item with the default locale. If there is no value for the default locale, use any locale available to return the value.

Parameters:
id -
Returns:
The strint value of the list data item.

getValue

java.lang.String getValue(int id,
                          java.util.Locale loc)
Returns the string value of the list data item with the given id in the given locale.

Parameters:
id - The id of the list data item.
loc - The locale of the list data item.
Returns:
The string value for the list data item.

getValues

java.util.List<ListItem> getValues(java.util.Locale loc)
Returns a list of ListItem in the given locale.

Parameters:
loc - The locale of the ListItems.
Returns:
A list of ListItems.

getValues

java.util.List<ListItem> getValues()
Returns a list of ListItem for the default locale. If there is no list for the default locale, then try any locale in order to return a list.

Returns:
A list of ListItems.

getName

java.lang.String getName()
Returns the name of this list.

Returns:
The name of the list.

size

int size()
Returns the size of this list. Note: the size does not depend on the number of locales.

Returns:
The size of the list.


Copyright © 2005 Mentawai Team. All Rights Reserved.