Revision 5576 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/SpatialCache.java

View differences:

SpatialCache.java
10 10

  
11 11
public class SpatialCache extends Quadtree {
12 12
	int maxFeatures = 1000; // Por defecto, pero se puede cambiar
13
	int fastNumTotalRegs=0;
13 14

  
14 15
	public int getMaxFeatures() {
15 16
		return maxFeatures;
......
28 29
	public synchronized void insert(Rectangle2D bounds, IGeometry geom) {
29 30
		Envelope env = FConverter.convertRectangle2DtoEnvelope(bounds);
30 31
		this.insert(env, geom);
32
		fastNumTotalRegs++;
31 33
	}
32 34

  
33 35
	public synchronized void query(Envelope searchEnv, ItemVisitor visitor)
......
35 37
		super.query(searchEnv, visitor);
36 38
	}
37 39

  
40
	public void insert(Envelope itemEnv, Object item) {
41
		super.insert(itemEnv, item);
42
		fastNumTotalRegs++;
43
	}
38 44

  
45
	public boolean remove(Envelope itemEnv, Object item) {
46
		boolean resul = super.remove(itemEnv, item);
47
		if (resul)
48
			fastNumTotalRegs--;
49
		return resul;
50
	}
51

  
52
	public int size() {
53
		return fastNumTotalRegs;
54
	}
55

  
56

  
39 57
}

Also available in: Unified diff