/** * A utility method that takes a list of dates and returns a list of DatedObjects * * @param dates List of dates to wrap * @return A list of DatedObjects */ public static List wrap(List dates) { List result = new ArrayList(); for (int i = 0; i < dates.size(); i++) { result.add(new DatedObject((Date) dates.get(i))); } return result; }
/** * A utility method that takes a list of DatedObjects-s and returns a list of the objects * * @param datedObjects List of objects * @return A list of the objects the datedobjects hold */ public static List getObjects(List datedObjects) { List result = new ArrayList(); if (datedObjects == null) { return result; } for (int i = 0; i < datedObjects.size(); i++) { result.add(((DatedObject) datedObjects.get(i)).getObject()); } return result; }
List<DatedThing> datedThings = DatedObject.sort(times, false);
new Date(System.currentTimeMillis()))).getTime(); for (int i = 0; i < 20; i++) { dates.add(new DatedObject(new Date(now + DateUtil.minutesToMillis(20) - i * 10 * 60 * 1000)));