org.mentawai.list
Interface ListData

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

public interface ListData

Defines how a data list works.

Author:
Sergio Oliveira

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

Method Detail

getValue

String getValue(String id,
                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

String getValue(String id)
Returns the string value for 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 string value of the list data item.

getValue

String getValue(int id,
                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

String getValue(int id)
Returns the string value of the list data item with the given id with the default locale.

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

getValues

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

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

getValues

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

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 © 2013. All Rights Reserved.