private static ProductEntry[] getClosestDatePairs(final ProductEntry[] entries, final ProductEntry master, final AOI aoi) { final double masterTime = master.getFirstLineTime().getMJD(); double cutoffTime = masterTime; final DBQuery slaveQuery = aoi.getSlaveDBQuery(); final double entryTime = entry.getFirstLineTime().getMJD(); if (entryTime < cutoffTime) { final double diff = Math.abs(masterTime - entryTime);
protected void updateData() { if (file != null) { data[0] = file.getName(); } else if (entry != null) { data[0] = entry.getName(); data[1] = entry.getProductType(); data[2] = entry.getFirstLineTime().format(); final MetadataElement meta = entry.getMetadata(); if (meta != null) { data[3] = String.valueOf(meta.getAttributeInt(AbstractMetadata.REL_ORBIT, 0)); data[4] = String.valueOf(meta.getAttributeInt(AbstractMetadata.ABS_ORBIT, 0)); } } }
final ProductData.UTC utc = entry.getFirstLineTime(); if(utc == null) { continue;
public int compare(final Object o1, final Object o2) { if (o1 == null && o2 == null) { return 0; } else if (o1 == null) { return -1; } else if (o2 == null) { return 1; } else if (o1 instanceof ProductEntry && o2 instanceof ProductEntry) { final ProductEntry e1 = (ProductEntry) o1; final ProductEntry e2 = (ProductEntry) o2; if (sortBy.equals(SORT_BY.NAME)) { return e1.getName().compareTo(e2.getName()); } else if (sortBy.equals(SORT_BY.TYPE)) { return e1.getProductType().compareTo(e2.getProductType()); } else if (sortBy.equals(SORT_BY.MISSON)) { return e1.getMission().compareTo(e2.getMission()); } else if (sortBy.equals(SORT_BY.DATE)) { return e1.getFirstLineTime().getAsDate().compareTo(e2.getFirstLineTime().getAsDate()); } else if (sortBy.equals(SORT_BY.FILESIZE)) { final Long size1 = e1.getFileSize(); final Long size2 = e2.getFileSize(); return size1.compareTo(size2); } } return o1.toString().compareTo(o2.toString()); } };
text.append("Date: " + entry.getFirstLineTime() + '\n'); text.append("Size: " + entry.getFileSizeString() + '\n');
: "(" + entry.getFileSizeString() + ")"; final String dateString = dateFormat.format(entry.getFirstLineTime().getAsDate());
Calendar startDate = selections[0].getFirstLineTime().getAsCalendar(); startDate.add(Calendar.DAY_OF_MONTH, -daysMinus); Calendar endDate = selections[0].getFirstLineTime().getAsCalendar(); endDate.add(Calendar.DAY_OF_MONTH, daysPlus); dbQuery.setStartEndDate(startDate, endDate);