@Override
  public PointFeature next() throws NoSuchElementException {
    if (!hasNext()) {
      throw new NoSuchElementException("This iterator has no more elements.");
    }
    
    assert pointFeature != null;
    PointFeature ret = pointFeature;
    calcBounds(ret);
    
    pointFeature = null;  // Feature has been consumed.
    return ret;
  }
@Override
  public PointFeature next() throws NoSuchElementException {
    if (!hasNext()) {
      throw new NoSuchElementException("This iterator has no more elements.");
    }
    
    assert pointFeature != null;
    PointFeature ret = pointFeature;
    calcBounds(ret);
    
    pointFeature = null;  
    return ret;
  }
@ Override public PointFeature next ( ) throws NoSuchElementException { if ( ! hasNext ( ) ) { throw new NoSuchElementException ( "This iterator has no more elements." ) ; } assert pointFeature != null ; PointFeature ret = pointFeature ; calcBounds ( ret ) ; pointFeature = null ; // Feature has been consumed. return ret ; }
but we can define a stronger contract.
but we can define a stronger contract .