Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mentawai.list
Class BaseListData  view BaseListData download BaseListData.java

java.lang.Object
  extended byorg.mentawai.list.BaseListData
All Implemented Interfaces:
ListData

public class BaseListData
extends java.lang.Object
implements ListData


Nested Class Summary
private static class BaseListData.IdComparator
           
private static class BaseListData.ValueComparator
           
 
Field Summary
private static java.lang.String FULLDIR
           
private  java.lang.String listDir
           
private  java.lang.String listname
           
private  java.util.Map map
           
static int ORDER_BY_FILE
           
static int ORDER_BY_ID
           
static int ORDER_BY_VALUE
           
private  int ordertype
           
private static java.lang.String SEP
           
private  java.util.Map values
           
 
Constructor Summary
BaseListData(java.lang.String listname)
           
BaseListData(java.lang.String listname, int ordertype)
           
BaseListData(java.lang.String listname, int ordertype, java.lang.String listDir)
           
 
Method Summary
private  int getIdFromLine(java.lang.String line)
           
 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.util.List getValues(java.util.Locale loc)
          Returns a list of ListDataItem in the given locale.
protected  void load()
           
private  java.util.List loadFileToList(java.util.Locale loc)
           
private  org.mentawai.i18n.I18N loadI18N(java.util.Locale loc)
           
 int size()
          Returns the size of this list.
private  void sort(java.util.List list, int ordertype)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FULLDIR

private static final java.lang.String FULLDIR

SEP

private static final java.lang.String SEP

ORDER_BY_ID

public static final int ORDER_BY_ID
See Also:
Constant Field Values

ORDER_BY_VALUE

public static final int ORDER_BY_VALUE
See Also:
Constant Field Values

ORDER_BY_FILE

public static final int ORDER_BY_FILE
See Also:
Constant Field Values

listname

private java.lang.String listname

ordertype

private int ordertype

listDir

private java.lang.String listDir

map

private java.util.Map map

values

private java.util.Map values
Constructor Detail

BaseListData

public BaseListData(java.lang.String listname,
                    int ordertype,
                    java.lang.String listDir)
             throws java.io.IOException

BaseListData

public BaseListData(java.lang.String listname,
                    int ordertype)
             throws java.io.IOException

BaseListData

public BaseListData(java.lang.String listname)
             throws java.io.IOException
Method Detail

getName

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

Specified by:
getName in interface ListData

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

getValues

public java.util.List getValues(java.util.Locale loc)
Description copied from interface: ListData
Returns a list of ListDataItem in the given locale.

Specified by:
getValues in interface ListData

getValue

public java.lang.String getValue(int id,
                                 java.util.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

loadFileToList

private java.util.List loadFileToList(java.util.Locale loc)
                               throws java.io.IOException

loadI18N

private org.mentawai.i18n.I18N loadI18N(java.util.Locale loc)
                                 throws java.io.IOException

getIdFromLine

private int getIdFromLine(java.lang.String line)

sort

private void sort(java.util.List list,
                  int ordertype)

load

protected void load()
             throws java.io.IOException