INews news = (INews) object;
Date date = DateUtils.getRecentDate(news);
/* Feed was visited Today */
if (date.getTime() > todayMillis)
new EntityGroupItem(gToday, news);
/* Feed was visited Yesterday */
else if (date.after(yesterday))
new EntityGroupItem(gYesterday, news);
/* Feed was visited Two Weeks Ago */
else if (date.after(earlierThisWeek))
new EntityGroupItem(gEarlierThisWeek, news);
/* Feed was visited Last Week */
else if (date.after(lastWeek))
new EntityGroupItem(gLastWeek, news);
/* Feed was visited more than a Week ago */
else
new EntityGroupItem(gOlder, news);
}
}
/* Select all that are non empty */
return maskEmpty(new ArrayList<EntityGroup>(Arrays.asList(new EntityGroup[] { gToday, gYesterday, gEarlierThisWeek, gLastWeek, gOlder })));