@Test public void testAccept_UserStartFileBoth() throws Exception { final JCheckBox filterCheckBox = new JCheckBox(); filterCheckBox.setSelected(true); TimeRangeFilter filter = new TimeRangeFilter(filterCheckBox); filter.startDate = new GregorianCalendar(2010, 0, 1, 12, 37, 15).getTime(); filter.endDate = null; filter.timeStampExtractor = new TimeStampExtractor("yyyyMMdd:hhmmss", "*${startDate}*${endDate}*"); assertTrue(filter.accept(new OpendapLeaf("sth__20100101:192345___20100102:012345__.nc", createNullDataset()))); assertFalse(filter.accept(new OpendapLeaf("sth__20091231:192345___20100102:012345__.nc", createNullDataset()))); assertFalse(filter.accept(new OpendapLeaf("sth__20091231:192345___20091231:233012__.nc", createNullDataset()))); }
@Override public boolean accept(OpendapLeaf leaf) { DateRange timeCoverage = leaf.getDataset().getTimeCoverage(); if (timeCoverage != null) { return fitsToServerSpecifiedTimeRange(timeCoverage); } return timeStampExtractor == null || fitsToUserSpecifiedTimeRange(leaf); }
TimeRangeFilter implements FilterComponent { @Override public boolean accept(OpendapLeaf leaf) { DateRange timeCoverage = leaf.getDataset().getTimeCoverage(); if (timeCoverage != null) { return fitsToServerSpecifiedTimeRange(timeCoverage); } return timeStampExtractor == null || fitsToUserSpecifiedTimeRange(leaf); } }
TimeRangeFilter implements FilterComponent { @Override public boolean accept(OpendapLeaf leaf) { DateRange timeCoverage = leaf.getDataset().getTimeCoverage(); if (timeCoverage != null) { return fitsToServerSpecifiedTimeRange(timeCoverage); } return timeStampExtractor == null || fitsToUserSpecifiedTimeRange(leaf); } TimeRangeFilter(final JCheckBox filterCheckBox); }
TimeRangeFilter implements FilterComponent { @Override public boolean accept(OpendapLeaf leaf) { DateRange timeCoverage = leaf.getDataset().getTimeCoverage(); if (timeCoverage != null) { return fitsToServerSpecifiedTimeRange(timeCoverage); } return timeStampExtractor == null || fitsToUserSpecifiedTimeRange(leaf); } TimeRangeFilter(final JCheckBox filterCheckBox); @Override JComponent getUI(); @Override boolean accept(OpendapLeaf leaf); @Override void addFilterChangeListener(FilterChangeListener listener); }
TimeRangeFilter implements FilterComponent { @Override public boolean accept(OpendapLeaf leaf) { DateRange timeCoverage = leaf.getDataset().getTimeCoverage(); if (timeCoverage != null) { return fitsToServerSpecifiedTimeRange(timeCoverage); } return timeStampExtractor == null || fitsToUserSpecifiedTimeRange(leaf); } TimeRangeFilter(final JCheckBox filterCheckBox); @Override JComponent getUI(); @Override boolean accept(OpendapLeaf leaf); @Override void addFilterChangeListener(FilterChangeListener listener); static final Logger LOG; }