commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1077823 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/Range.java test/java/org/apache/commons/lang3/RangeTest.java
Date Fri, 04 Mar 2011 06:12:56 GMT
Author: bayard
Date: Fri Mar  4 06:12:56 2011
New Revision: 1077823

URL: http://svn.apache.org/viewvc?rev=1077823&view=rev
Log:
Changing Range.containsRange to containsAll and Range.overlapsRange to overlapsWith

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Range.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RangeTest.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Range.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Range.java?rev=1077823&r1=1077822&r2=1077823&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Range.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/Range.java Fri Mar  4
06:12:56 2011
@@ -278,7 +278,7 @@ public final class Range<T> implements S
      *  this range; otherwise, <code>false</code>
      * @throws IllegalArgumentException if the <code>Range</code> cannot be compared
      */
-    public boolean containsRange(Range<T> range) {
+    public boolean containsAll(Range<T> range) {
         if (range == null) {
             return false;
         }
@@ -296,7 +296,7 @@ public final class Range<T> implements S
      *  range; otherwise, <code>false</code>
      * @throws IllegalArgumentException if the <code>Range</code> cannot be compared
      */
-    public boolean overlapsRange(Range<T> range) {
+    public boolean overlapsWith(Range<T> range) {
         if (range == null) {
             return false;
         }

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RangeTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RangeTest.java?rev=1077823&r1=1077822&r2=1077823&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RangeTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/RangeTest.java Fri Mar
 4 06:12:56 2011
@@ -205,67 +205,67 @@ public class RangeTest extends TestCase 
 
     // --------------------------------------------------------------------------
 
-    public void testContainsRange() {
+    public void testContainsAll() {
 
         // null handling
-        assertFalse(intRange.containsRange(null));
+        assertFalse(intRange.containsAll(null));
 
         // easy inside range
-        assertTrue(intRange.containsRange(Range.between(12, 18)));
+        assertTrue(intRange.containsAll(Range.between(12, 18)));
 
         // outside range on each side
-        assertFalse(intRange.containsRange(Range.between(32, 45)));
-        assertFalse(intRange.containsRange(Range.between(2, 8)));
+        assertFalse(intRange.containsAll(Range.between(32, 45)));
+        assertFalse(intRange.containsAll(Range.between(2, 8)));
 
         // equals range
-        assertTrue(intRange.containsRange(Range.between(10, 20)));
+        assertTrue(intRange.containsAll(Range.between(10, 20)));
 
         // overlaps
-        assertFalse(intRange.containsRange(Range.between(9, 14)));
-        assertFalse(intRange.containsRange(Range.between(16, 21)));
+        assertFalse(intRange.containsAll(Range.between(9, 14)));
+        assertFalse(intRange.containsAll(Range.between(16, 21)));
 
         // touches lower boundary
-        assertTrue(intRange.containsRange(Range.between(10, 19)));
-        assertFalse(intRange.containsRange(Range.between(10, 21)));
+        assertTrue(intRange.containsAll(Range.between(10, 19)));
+        assertFalse(intRange.containsAll(Range.between(10, 21)));
 
         // touches upper boundary
-        assertTrue(intRange.containsRange(Range.between(11, 20)));
-        assertFalse(intRange.containsRange(Range.between(9, 20)));
+        assertTrue(intRange.containsAll(Range.between(11, 20)));
+        assertFalse(intRange.containsAll(Range.between(9, 20)));
         
         // negative
-        assertFalse(intRange.containsRange(Range.between(-11, -18)));
+        assertFalse(intRange.containsAll(Range.between(-11, -18)));
 
     }
 
-    public void testOverlapsRange() {
+    public void testOverlapsWith() {
 
         // null handling
-        assertFalse(intRange.overlapsRange(null));
+        assertFalse(intRange.overlapsWith(null));
 
         // easy inside range
-        assertTrue(intRange.overlapsRange(Range.between(12, 18)));
+        assertTrue(intRange.overlapsWith(Range.between(12, 18)));
 
         // outside range on each side
-        assertFalse(intRange.overlapsRange(Range.between(32, 45)));
-        assertFalse(intRange.overlapsRange(Range.between(2, 8)));
+        assertFalse(intRange.overlapsWith(Range.between(32, 45)));
+        assertFalse(intRange.overlapsWith(Range.between(2, 8)));
 
         // equals range
-        assertTrue(intRange.overlapsRange(Range.between(10, 20)));
+        assertTrue(intRange.overlapsWith(Range.between(10, 20)));
 
         // overlaps
-        assertTrue(intRange.overlapsRange(Range.between(9, 14)));
-        assertTrue(intRange.overlapsRange(Range.between(16, 21)));
+        assertTrue(intRange.overlapsWith(Range.between(9, 14)));
+        assertTrue(intRange.overlapsWith(Range.between(16, 21)));
 
         // touches lower boundary
-        assertTrue(intRange.overlapsRange(Range.between(10, 19)));
-        assertTrue(intRange.overlapsRange(Range.between(10, 21)));
+        assertTrue(intRange.overlapsWith(Range.between(10, 19)));
+        assertTrue(intRange.overlapsWith(Range.between(10, 21)));
 
         // touches upper boundary
-        assertTrue(intRange.overlapsRange(Range.between(11, 20)));
-        assertTrue(intRange.overlapsRange(Range.between(9, 20)));
+        assertTrue(intRange.overlapsWith(Range.between(11, 20)));
+        assertTrue(intRange.overlapsWith(Range.between(9, 20)));
         
         // negative
-        assertFalse(intRange.overlapsRange(Range.between(-11, -18)));
+        assertFalse(intRange.overlapsWith(Range.between(-11, -18)));
 
     }
 



Mime
View raw message