コード例 #1
0
 /*
  * Test method for 'net.refractions.udig.tools.edit.support.PrimitiveShape.iterator()'
  */
 @Test
 public void testIterator() {
   Iterator<Point> iter = shell.iterator();
   assertTrue(iter.hasNext());
   assertEquals(Point.valueOf(10, 10), iter.next());
   assertEquals(Point.valueOf(11, 10), iter.next());
   assertEquals(Point.valueOf(10, 10), iter.next());
   assertEquals(Point.valueOf(2, 20), iter.next());
   assertEquals(Point.valueOf(4000, 8000), iter.next());
 }
コード例 #2
0
  private boolean isDoneInternal() {
    if (nextPoint != null) return false;

    if (points != null && points.hasNext()) {
      nextPoint = points.next();
      return false;
    }

    // points is null or is done so get next shape
    while (shapes.hasNext()) {
      currentShape = shapes.next();

      points = currentShape.iterator();

      if (points.hasNext()) {
        nextPoint = points.next();
        break;
      }
    }

    return nextPoint == null;
  }