Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / operations / strategies / StrategyManager.java @ 1034

History | View | Annotate | Download (1.19 KB)

1
package com.iver.cit.gvsig.fmap.operations.strategies;
2

    
3
import com.iver.cit.gvsig.fmap.drivers.BoundedShapes;
4
import com.iver.cit.gvsig.fmap.layers.FLayer;
5
import com.iver.cit.gvsig.fmap.layers.VectorialAdapter;
6
import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer;
7

    
8

    
9
/**
10
 * Clase con m?todos est?ticos para crear la estategia.
11
 *
12
 * @author Vicente Caballero Navarro
13
 */
14
public class StrategyManager {
15
        /**
16
         * Se encarga de, dada una clase que implementa el interfaz vectorial,
17
         * seleccionar la estrategia ?ptima de acceso a las capas, devolviendo el
18
         * objeto Strategy con la capa vectorial asociada.
19
         *
20
         * @param v SingleLayer.
21
         *
22
         * @return Estrategia.
23
         */
24
        public static Strategy getStrategy(SingleLayer v) {
25
                if (v.getSource().getDriver() instanceof BoundedShapes) {
26
                        return new ShpStrategy((FLayer) v);
27
                } else {
28
                        return new DefaultStrategy((FLayer) v);
29
                }
30
        }
31

    
32
        /**
33
         * Crea un ShapeInfo en memoria o en disco en funci?n de la memoria
34
         * disponible
35
         *
36
         * @param adapter VectorialAdapter.
37
         *
38
         * @return ShapeInfo.
39
         */
40
        public static ShapeInfo createShapeInfo(VectorialAdapter adapter) {
41
                //TODO falta que implementar el DiskShapeInfo.
42
                return new MemoryShapeInfo();
43
        }
44
}