org.mentawai.list
Class SimpleListData

java.lang.Object
  extended by org.mentawai.list.SimpleListData
All Implemented Interfaces:
ListData

public class SimpleListData
extends Object
implements ListData

This class implements the simplest possible data list, with no locales or i18n files. Use this class if you don't want to deal with internationalization and i18n files, in other words, you just want a list.

Since:
1.1.1
Author:
Sergio Oliveira

Constructor Summary
SimpleListData()
           
SimpleListData(String name)
           
 
Method Summary
 void add(Enum e, String msg)
           
 void add(int id, String msg)
           
 void add(String id, String msg)
           
 void clear()
           
static ListData getDaysOfTheMonth(String name)
           
 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.
static ListData getYears(String name, int begin, int end)
           
 int size()
          Returns the size of this list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleListData

public SimpleListData()

SimpleListData

public SimpleListData(String name)
Method Detail

clear

public void clear()

add

public void add(int id,
                String msg)

add

public void add(String id,
                String msg)

add

public void add(Enum e,
                String msg)

getValue

public String getValue(String id)
Description copied from interface: ListData
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.

Specified by:
getValue in interface ListData
Returns:
The string value of the list data item.

getValue

public String getValue(int id)
Description copied from interface: ListData
Returns the string value of the list data item with the given id with the default locale.

Specified by:
getValue in interface ListData
Parameters:
id - The id of the list data item
Returns:
The string value of the list data item

getValue

public String getValue(String id,
                       Locale loc)
Description copied from interface: ListData
Returns the string value of the list data item with the given id in the given locale.

Specified by:
getValue in interface ListData
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

public String getValue(int id,
                       Locale loc)
Description copied from interface: ListData
Returns the string value of the list data item with the given id in the given locale.

Specified by:
getValue in interface ListData
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

public List<ListItem> getValues()
Description copied from interface: ListData
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.

Specified by:
getValues in interface ListData
Returns:
A list of ListItems.

getValues

public List<ListItem> getValues(Locale loc)
Description copied from interface: ListData
Returns a list of ListItem in the given locale.

Specified by:
getValues in interface ListData
Parameters:
loc - The locale of the ListItems.
Returns:
A list of ListItems.

getName

public String getName()
Description copied from interface: ListData
Returns the name of this list.

Specified by:
getName in interface ListData
Returns:
The name of the list.

size

public int size()
Description copied from interface: ListData
Returns the size of this list. Note: the size does not depend on the number of locales.

Specified by:
size in interface ListData
Returns:
The size of the list.

toString

public String toString()
Overrides:
toString in class Object

getDaysOfTheMonth

public static ListData getDaysOfTheMonth(String name)

getYears

public static ListData getYears(String name,
                                int begin,
                                int end)


Copyright © 2013. All Rights Reserved.