Build 1.0_r1(from source)

android.webkit
Class DateSorter

java.lang.Object
  extended by android.webkit.DateSorter

public class DateSorter
extends Object

Sorts dates into the following groups: Today Yesterday five days ago one month ago older than a month ago


Field Summary
static int DAY_COUNT
          must be >= 3
(package private)  Calendar mCal
           
(package private)  Date mDate
           
 
Constructor Summary
DateSorter(Context context)
           
 
Method Summary
 long getBoundary(int index)
           
 int getIndex(long time)
           
 String getLabel(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAY_COUNT

public static final int DAY_COUNT
must be >= 3

See Also:
Constant Field Values

mDate

Date mDate

mCal

Calendar mCal
Constructor Detail

DateSorter

public DateSorter(Context context)
Parameters:
context - Application context
Method Detail

getIndex

public int getIndex(long time)
Parameters:
time - time since the Epoch in milliseconds, such as that returned by Calendar.getTimeInMillis()
Returns:
an index from 0 to (DAY_COUNT - 1) that identifies which date bin this date belongs to

getLabel

public String getLabel(int index)
Parameters:
index - date bin index as returned by getIndex()
Returns:
string label suitable for display to user

getBoundary

public long getBoundary(int index)
Parameters:
index - date bin index as returned by getIndex()
Returns:
date boundary at given index

Build 1.0_r1(from source)

Please submit a feedback, bug or feature