IMark mark = (IMark) object;
Date lastVisitDate = mark.getLastVisitDate();
/* Feed was never visited */
if (lastVisitDate == null)
new EntityGroupItem(gNever, mark);
/* Feed was visited Today */
else if (lastVisitDate.getTime() >= todayMillis)
new EntityGroupItem(gToday, mark);
/* Feed was visited Yesterday */
else if (lastVisitDate.compareTo(yesterday) >= 0)
new EntityGroupItem(gYesterday, mark);
/* Feed was visited Earlier this Week */
else if (lastVisitDate.compareTo(earlierThisWeek) >= 0)
new EntityGroupItem(gEarlierThisWeek, mark);
/* Feed was visited Last Week */
else if (lastVisitDate.compareTo(lastWeek) >= 0)
new EntityGroupItem(gLastWeek, mark);
/* Feed was visited more than a Week ago */
else
new EntityGroupItem(gOlder, mark);
}
}
/* Select all that are non empty */
return maskEmpty(new ArrayList<EntityGroup>(Arrays.asList(new EntityGroup[] { gNever, gToday, gYesterday, gEarlierThisWeek, gLastWeek, gOlder })));