de.msponer.android.yac.adapter
Class LocalizedWorkItemAdapter

java.lang.Object
  extended by android.widget.BaseAdapter
      extended by android.widget.ArrayAdapter<MobileWorkItem>
          extended by de.msponer.android.yac.adapter.LocalizedWorkItemAdapter
All Implemented Interfaces:
Adapter, Filterable, ListAdapter, SpinnerAdapter

public class LocalizedWorkItemAdapter
extends ArrayAdapter<MobileWorkItem>

Adapter class for localized work items.

Author:
msponer

Field Summary
 
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
 
Constructor Summary
LocalizedWorkItemAdapter(Context context, int textViewResourceId, List<MobileWorkItem> workitemList)
          Constructor setting the required fields.
 
Method Summary
 View getView(int position, View convertView, ViewGroup parent)
           The view component containing the localized work item information.
 List<MobileWorkItem> getWorkitemList()
          Returns the current localized work item list.
static double round(double val, int sca)
          Rounds a given value.
 void setWorkitemList(List<MobileWorkItem> workitemList)
          Sets the current localized work item list.
 
Methods inherited from class android.widget.ArrayAdapter
add, clear, createFromResource, getContext, getCount, getDropDownView, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setNotifyOnChange, sort
 
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizedWorkItemAdapter

public LocalizedWorkItemAdapter(Context context,
                                int textViewResourceId,
                                List<MobileWorkItem> workitemList)
Constructor setting the required fields.

Parameters:
context - The application context.
textViewResourceId - The view id.
workitemList - The localized work item list.
Method Detail

getView

public View getView(int position,
                    View convertView,
                    ViewGroup parent)
The view component containing the localized work item information.

Specified by:
getView in interface Adapter
Overrides:
getView in class ArrayAdapter<MobileWorkItem>

round

public static double round(double val,
                           int sca)
Rounds a given value.

Parameters:
val - The value to round.
sca - The scale.
Returns:
The rounded valued.

setWorkitemList

public void setWorkitemList(List<MobileWorkItem> workitemList)
Sets the current localized work item list.

Parameters:
workitemList - The localized work item list.

getWorkitemList

public List<MobileWorkItem> getWorkitemList()
Returns the current localized work item list.

Returns:
The current work item list.