Revision 45746

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/aggregate/AbstractMultiPrimitive.java
27 27
import java.util.List;
28 28

  
29 29
import org.gvsig.fmap.geom.Geometry;
30
import org.gvsig.fmap.geom.aggregate.Aggregate;
30 31
import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
31 32
import org.gvsig.fmap.geom.handler.Handler;
32 33
import org.gvsig.fmap.geom.operation.GeometryOperationException;
......
69 70
        }
70 71
    }
71 72

  
73
    @Override
74
    public void addPrimitives(Aggregate aggregate) {
75
        for (Geometry primitive : aggregate) {
76
            this.addPrimitive((Primitive) primitive);
77
        }
78
    }
79

  
80
    @Override
81
    public void addPrimitives(Geometry geometry) {
82
        if(geometry instanceof Primitive){
83
            addPrimitive((Primitive) geometry);
84
        } else {
85
            addPrimitives((Aggregate)geometry);
86
        }
87
    }
88

  
72 89
    /**
73 90
     * @param primitive
74 91
     * @return
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.api/src/main/java/org/gvsig/fmap/geom/aggregate/MultiPrimitive.java
21 21
 * For any additional information, do not hesitate to contact us
22 22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23 23
 */
24

  
25 24
package org.gvsig.fmap.geom.aggregate;
26 25

  
26
import org.gvsig.fmap.geom.Geometry;
27 27
import org.gvsig.fmap.geom.primitive.Primitive;
28 28

  
29 29
/**
30 30
 * <p>
31
 * This interface is equivalent to the GM_MultiPrimitive specified in 
32
 * <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
33
 * MultiPrimitive is the root class for all primitive aggregates. 
34
 * The association role "element" shall be the set of {@link Primitive}'s contained 
31
 * This interface is equivalent to the GM_MultiPrimitive specified in
32
 * <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO
33
 * 19107</a>. MultiPrimitive is the root class for all primitive aggregates. The
34
 * association role "element" shall be the set of {@link Primitive}'s contained
35 35
 * in this MultiPrimitive.
36 36
 * </p>
37
 * @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
37
 *
38
 * @see
39
 * <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO
40
 * 19107</a>
38 41
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
39 42
 */
40 43
public interface MultiPrimitive extends Aggregate {
41 44

  
42
	/**
43
	 * Adds a new primitive to the primitive
44
	 * @param primitive
45
	 * The primitive to add
46
	 */
47
	void addPrimitive(Primitive primitive);
48
	
49
	public void ensureCapacity(int capacity);
45
    /**
46
     * Adds a new primitive to the primitive
47
     *
48
     * @param primitive The primitive to add
49
     */
50
    public void addPrimitive(Primitive primitive);
51

  
52
    public void addPrimitives(Aggregate aggregate);
53

  
54
    public void addPrimitives(Geometry geometry);
55

  
56
    public void ensureCapacity(int capacity);
50 57
}

Also available in: Unified diff