Package ns.foundation

Examples of ns.foundation.NSMutableRange


    assertFalse(range.equals(otherRange));
   
    otherRange = null;
    assertFalse(range.equals(otherRange));
   
    otherRange = new NSMutableRange(2, 3);
    assertTrue(range.equals(otherRange));
  }
View Full Code Here


    assertEquals(0, NSRange.ZeroRange.location());
    assertEquals(0, NSRange.ZeroRange.length());
  }
 
  public void testSubtractRangeNoIntersect() {
    NSMutableRange result1 = new NSMutableRange();
    NSMutableRange result2 = new NSMutableRange();
   
    // no intersection
    NSRange testRange = new NSRange(0, 2); // 0, 1
    NSRange subRange = new NSRange(2, 2)// 2, 3
    testRange.subtractRange(subRange, result1, result2);
View Full Code Here

    assertEquals(result1, new NSRange(0, 0));
    assertEquals(result2, new NSRange(0, 0));
  }

  public void testSubtractRangeTotalIntersect() {
    NSMutableRange result1 = new NSMutableRange();
    NSMutableRange result2 = new NSMutableRange();

    // total intersection
    NSRange testRange = new NSRange(1, 2); // 1, 2
    NSRange subRange = new NSRange(0, 4)// 0, 1, 2, 3, 4
    testRange.subtractRange(subRange, result1, result2);
    assertEquals(0, result1.length());
    assertEquals(0, result2.length());
  }
View Full Code Here

    assertEquals(0, result1.length());
    assertEquals(0, result2.length());
  }

  public void testSubtractRangeStartIntersect() {
    NSMutableRange result1 = new NSMutableRange();
    NSMutableRange result2 = new NSMutableRange();

    // start intersection
    NSRange testRange = new NSRange(1, 2); // 1, 2
    NSRange subRange = new NSRange(0, 2);   // 0, 1
    testRange.subtractRange(subRange, result1, result2);
    assertEquals(new NSMutableRange(2, 1), result1);
    assertEquals(new NSMutableRange(0, 0), result2);
  }
View Full Code Here

    assertEquals(new NSMutableRange(2, 1), result1);
    assertEquals(new NSMutableRange(0, 0), result2);
  }

  public void testSubtractRangeEndIntersect() {
    NSMutableRange result1 = new NSMutableRange();
    NSMutableRange result2 = new NSMutableRange();

    // end intersection
    NSRange testRange = new NSRange(1, 2); // 1, 2
    NSRange subRange = new NSRange(2,2);   // 2, 3
    testRange.subtractRange(subRange, result1, result2);
    assertEquals(new NSMutableRange(1, 1), result1);
    assertEquals(new NSMutableRange(0, 0), result2);
  }
View Full Code Here

    assertEquals(0, range.location());
    assertEquals(0, range.length());
  }

  public void testNSMutableRangeIntInt() {
    NSMutableRange range = new NSMutableRange(2,3);
    assertEquals(2, range.location());
    assertEquals(3, range.length());
  }
View Full Code Here

    assertEquals(2, range.location());
    assertEquals(3, range.length());
  }

  public void testNSMutableRangeNSRange() {
    NSMutableRange range = new NSMutableRange(1,1);
    NSMutableRange otherRange = new NSMutableRange(range);
    assertEquals(range, otherRange);
  }
View Full Code Here

    NSMutableRange otherRange = new NSMutableRange(range);
    assertEquals(range, otherRange);
  }

  public void testClone() {
    NSMutableRange range = new NSMutableRange(2,3);
    NSMutableRange clone = (NSMutableRange) range.clone();
    assertEquals(range, clone);
  }
View Full Code Here

    NSMutableRange clone = (NSMutableRange) range.clone();
    assertEquals(range, clone);
  }

  public void testIntersectRange() {
    NSMutableRange range = new NSMutableRange(2,3);
    NSRange otherRange = new NSRange(3, 3);
    range.intersectRange(otherRange);
    assertEquals(3, range.location());
    assertEquals(2, range.length());
  }
View Full Code Here

    assertEquals(3, range.location());
    assertEquals(2, range.length());
  }

  public void testSetLength() {
    NSMutableRange range = new NSMutableRange(2,3);
    assertEquals(3, range.length());
    range.setLength(1);
    assertEquals(1, range.length());
  }
View Full Code Here

TOP

Related Classes of ns.foundation.NSMutableRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.