/** * <p>Tests whether the specified <code>number</code> occurs within * this range using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param number the number to test, may be <code>null</code> * @return <code>true</code> if the specified number occurs within this range */ public boolean containsNumber(Number number) { if (number == null) { return false; } return containsLong(number.longValue()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsLong(range.getMinimumLong()) && containsLong(range.getMaximumLong()); }
/** * <p>Tests whether the specified range overlaps with this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range overlaps with this range */ public boolean overlapsRange(Range range) { if (range == null) { return false; } return range.containsLong(min) || range.containsLong(max) || containsLong(range.getMinimumLong()); }
/** * <p>Tests whether the specified <code>number</code> occurs within * this range using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param number the number to test, may be <code>null</code> * @return <code>true</code> if the specified number occurs within this range */ public boolean containsNumber(Number number) { if (number == null) { return false; } return containsLong(number.longValue()); }
/** * <p>Tests whether the specified <code>number</code> occurs within * this range using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param number the number to test, may be <code>null</code> * @return <code>true</code> if the specified number occurs within this range */ public boolean containsNumber(Number number) { if (number == null) { return false; } return containsLong(number.longValue()); }
/** * <p>Tests whether the specified <code>number</code> occurs within * this range using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param number the number to test, may be <code>null</code> * @return <code>true</code> if the specified number occurs within this range */ public boolean containsNumber(Number number) { if (number == null) { return false; } return containsLong(number.longValue()); }
/** * <p>Tests whether the specified <code>number</code> occurs within * this range using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param number the number to test, may be <code>null</code> * @return <code>true</code> if the specified number occurs within this range */ public boolean containsNumber(Number number) { if (number == null) { return false; } return containsLong(number.longValue()); }
/** * <p>Tests whether the specified <code>number</code> occurs within * this range using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param number the number to test, may be <code>null</code> * @return <code>true</code> if the specified number occurs within this range */ public boolean containsNumber(Number number) { if (number == null) { return false; } return containsLong(number.longValue()); }
@Override public boolean accept(Key k, Value v) { return range.containsLong(k.getTimestamp()); }
@Override public boolean apply(Key input) { final long timestamp = input.getTimestamp(); return acceptedRange.containsLong(timestamp); } }
private boolean acceptTimestamp(Key k) { return this.stampRange.containsLong(k.getTimestamp()); }
private boolean acceptTimestamp(Key k) { return this.stampRange.containsLong(k.getTimestamp()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsLong(range.getMinimumLong()) && containsLong(range.getMaximumLong()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsLong(range.getMinimumLong()) && containsLong(range.getMaximumLong()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsLong(range.getMinimumLong()) && containsLong(range.getMaximumLong()); }
/** * <p>Tests whether the specified range overlaps with this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range overlaps with this range */ public boolean overlapsRange(Range range) { if (range == null) { return false; } return range.containsLong(min) || range.containsLong(max) || containsLong(range.getMinimumLong()); }
/** * <p>Tests whether the specified range overlaps with this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range overlaps with this range */ public boolean overlapsRange(Range range) { if (range == null) { return false; } return range.containsLong(min) || range.containsLong(max) || containsLong(range.getMinimumLong()); }
/** * <p>Tests whether the specified range overlaps with this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range overlaps with this range */ public boolean overlapsRange(Range range) { if (range == null) { return false; } return range.containsLong(min) || range.containsLong(max) || containsLong(range.getMinimumLong()); }
/** * <p>Tests whether the specified range overlaps with this range * using <code>long</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range overlaps with this range */ public boolean overlapsRange(Range range) { if (range == null) { return false; } return range.containsLong(min) || range.containsLong(max) || containsLong(range.getMinimumLong()); }
/** * Test not setting the time stamps of the flag files */ @Test public void testUnsetFlagFileTimeStamps() throws Exception { File f = setUpFlagDir(); // two days, 5 files each day, two folders in fmc = 20 flags LongRange range = createTestFiles(2, 5); fmc.setSetFlagFileTimestamp(false); FlagMaker instance = new TestWrappedFlagMaker(fmc); instance.processFlags(); // ensure the flag files have appropriate dates for (File file : f.listFiles()) { if (file.getName().endsWith(".flag")) { assertFalse(range.containsLong(file.lastModified())); } } }