/** * Is this date after the given date. if isPresent, always true. * * @param d test against this date * @return true if this date after the given date */ public boolean after(Date d) { if (isPresent()) return true; return date.isAfter(CalendarDate.of(d)); }
/** * Is this date after the given date. if isPresent, always true. * * @param d test against this date * @return true if this date after the given date */ public boolean after(Date d) { if (isPresent()) return true; return date.isAfter(CalendarDate.of(d)); }
/** * Is this date after the given date. if isPresent, always true. * * @param d test against this date * @return true if this date after the given date */ public boolean after(Date d) { if (isPresent()) return true; return date.isAfter(CalendarDate.of(d)); }
protected void trackBB(LatLonPoint loc, CalendarDate obsDate) { if (loc != null) { if (llbb == null) { llbb = new LatLonRect(loc, .001, .001); return; } llbb.extend(loc); } // date is handled specially if ((minDate == null) || minDate.isAfter(obsDate)) minDate = obsDate; if ((maxDate == null) || maxDate.isBefore(obsDate)) maxDate = obsDate; }
else if (startDate.isAfter(tinvd.start)) startDate = tinvd.start;
protected void trackBB(LatLonPoint loc, CalendarDate obsDate) { if (loc != null) { if (llbb == null) { llbb = new LatLonRect(loc, .001, .001); return; } llbb.extend(loc); } // date is handled specially if ((minDate == null) || minDate.isAfter(obsDate)) minDate = obsDate; if ((maxDate == null) || maxDate.isBefore(obsDate)) maxDate = obsDate; }
protected void trackBB(EarthLocation loc, CalendarDate obsDate) { if (loc != null) { if (llbb == null) { llbb = new LatLonRect(loc.getLatLon(), .001, .001); return; } llbb.extend(loc.getLatLon()); } // date is handled specially if ((minDate == null) || minDate.isAfter(obsDate)) minDate = obsDate; if ((maxDate == null) || maxDate.isBefore(obsDate)) maxDate = obsDate; }
private List<CollectionManager> makePartitionsByPeriod() throws IOException { this.type = Type.timePeriod; List<DatedMFile> files = new ArrayList<DatedMFile>(); for (MFile mfile : getFiles()) { CalendarDate cdate = dateExtractor.getCalendarDate(mfile); if (cdate == null) logger.error("Date extraction failed on file= {} dateExtractor = {}", mfile.getPath(), dateExtractor); files.add( new DatedMFile(mfile, cdate)); } Collections.sort(files); CalendarDateFormatter cdf = new CalendarDateFormatter("yyyyMMdd"); List<CollectionManager> result = new ArrayList<CollectionManager>(); TimePartitionCollectionManager curr = null; for (DatedMFile dmf : files) { if ((curr == null) || (!curr.endPartition.isAfter(dmf.cdate))) { CalendarPeriod period = CalendarPeriod.of(config.timePartition); CalendarDate start = dmf.cdate.truncate(period.getField()); // start on a boundary CalendarDate end = start.add( period); String name = collectionName + "-"+ cdf.toString(dmf.cdate); curr = new TimePartitionCollectionManager(name, start, end, getRoot(), this.auxInfo, this.logger); result.add(curr); } curr.add(dmf); } return result; }
public Iterable<MCollection> makePartitions(CollectionUpdateType forceCollection) throws IOException { List<MCollection> result = new ArrayList<>(); CollectionListRange curr = null; CalendarDate startDate = null; CalendarDate endDate = null; for (MFile mfile : getFilesSorted()) { CalendarDate cdate = dateExtractor.getCalendarDate(mfile); if (cdate == null) continue; // skip - error should be logged if ((curr == null) || !endDate.isAfter(cdate)) { startDate = cdate.truncate(timePeriod.getField()); // start on a boundary endDate = startDate.add( timePeriod); String name = collectionName + "-"+ cdf.toString(startDate); curr = new CollectionListRange(name, root, startDate, endDate, this.logger); curr.putAuxInfo(FeatureCollectionConfig.AUX_CONFIG, this.config); if (!wasRemoved( curr)) result.add(curr); // skip if in removed list } //System.out.printf("%s%n", mfile); curr.addFile(mfile); } return result; }
CalendarDate edge2 = timeOffsetAxis.makeDate(runDate, timeOffsetAxis.getCoordEdge2(0)); Assert.assertTrue(edge1.toString(), !edge1.isAfter(time_val)); Assert.assertTrue(edge2.toString(), !edge2.isBefore(time_val));
CalendarDate edge2 = timeOffsetAxis.makeDate(timeOffsetAxis.getCoordEdge2(0)); Assert.assertTrue(edge1+">"+time_val, !edge1.isAfter(time_val)); Assert.assertTrue(edge2+"<"+time_val, !edge2.isBefore(time_val));
double[] wantTimeOffsetIntv = coords.getTimeOffsetIntv(); if (wantTimeOffset != null) { Assert.assertTrue("time coord lower", !tinv.getStart().isAfter(wantTimeOffset)); // lower <= time Assert.assertTrue("time coord upper", !tinv.getEnd().isBefore(wantTimeOffset));// upper >= time
if (timeAxis.isInterval()) { CalendarDate lower = timeAxis1D.makeDate(timeAxis1D.getCoordEdge1(0)); Assert.assertTrue("time coord lower", !lower.isAfter(time)); // lower <= time CalendarDate upper = timeAxis1D.makeDate(timeAxis1D.getCoordEdge2(0)); Assert.assertTrue("time coord lower", !upper.isBefore(time)); // upper >= time
if (timeAxis.isInterval()) { CalendarDate lower = timeAxis1D.makeDate(timeAxis1D.getCoordEdge1(0)); Assert.assertTrue("time coord lower", !lower.isAfter(time)); // lower <= time CalendarDate upper = timeAxis1D.makeDate(timeAxis1D.getCoordEdge2(0)); Assert.assertTrue("time coord lower", !upper.isBefore(time)); // upper >= time