org.mentawai.list
Class CustomListData

java.lang.Object
  extended by org.mentawai.list.CustomListData
All Implemented Interfaces:
Runnable, ListData

public abstract class CustomListData
extends Object
implements ListData, Runnable


Constructor Summary
CustomListData(String name)
           
 
Method Summary
 String getName()
          Returns the name of this list.
 String getValue(int key)
          Returns the string value of the list data item with the given id with the default locale.
 String getValue(int key, Locale loc)
          Returns the string value of the list data item with the given id in the given locale.
 String getValue(String key)
          Returns the string value for the list data item with the default locale.
 String getValue(String key, 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.
abstract  ListData load(Connection conn)
           
 void load(ConnectionHandler connHandler)
           
 void refresh(Connection conn)
           
 void refresh(ConnectionHandler connHandler)
           
 void run()
           
 int size()
          Returns the size of this list.
 void startAutoRefresh(ConnectionHandler connHandler, long time)
           
 void stopAutoRefresh()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomListData

public CustomListData(String name)
Method Detail

startAutoRefresh

public void startAutoRefresh(ConnectionHandler connHandler,
                             long time)

stopAutoRefresh

public void stopAutoRefresh()

run

public void run()
Specified by:
run in interface Runnable

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.

getValue

public String getValue(String key,
                       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:
key - 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(String key)
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 key)
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:
key - The id of the list data item
Returns:
The string value of the list data item

getValue

public String getValue(int key,
                       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:
key - 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(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.

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.

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.

load

public void load(ConnectionHandler connHandler)
          throws SQLException
Throws:
SQLException

load

public abstract ListData load(Connection conn)
                       throws SQLException
Throws:
SQLException

refresh

public void refresh(ConnectionHandler connHandler)
             throws SQLException
Throws:
SQLException

refresh

public void refresh(Connection conn)
             throws SQLException
Throws:
SQLException


Copyright © 2013. All Rights Reserved.