Revision 12099 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/VectorialEditableDBAdapter.java

View differences:

VectorialEditableDBAdapter.java
40 40
 */
41 41
public class VectorialEditableDBAdapter extends VectorialEditableAdapter
42 42
		implements ISpatialDB {
43

  
43
	private int maxIndex=0;
44 44
	private class MyIterator implements IFeatureIterator {
45 45
		private Rectangle2D extent = null;
46 46

  
......
62 62

  
63 63
		private boolean bOriginalCursorOpened = true;
64 64

  
65

  
66 65
		public MyIterator(Rectangle2D r, String strEPSG) throws ReadDriverException {
67 66
			extent = r;
68 67
			epsg = strEPSG;
......
314 313
				 IFeature feat = ova.getFeature(i);
315 314
				 Integer calculatedIndex = new Integer(i);
316 315
				 mapFID2index.put(feat.getID(), calculatedIndex);
316
				 int featInt=Integer.parseInt(feat.getID());
317
				 if (maxIndex<featInt){
318
					 maxIndex=featInt;
319
				 }
317 320
				 mapIndex2FID.put(calculatedIndex, feat.getID());
318 321
			 }
319 322

  
......
461 464
		mapFID2index.clear();
462 465
		mapIndex2FID.clear();
463 466
	}
467
	public int getNewIndex(){
468
		int index = maxIndex+1;
469
		while(mapFID2index.containsKey(String.valueOf(index))){
470
			index++;
471
		}
472
		return index;
473
	}
464 474

  
465

  
466 475
}

Also available in: Unified diff