Revision 21047 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/operation/GeometryOperationContext.java
GeometryOperationContext.java | ||
---|---|---|
4 | 4 |
import java.util.Map; |
5 | 5 |
|
6 | 6 |
/** |
7 |
* Clase base que sirve de contenedor de parámetros |
|
8 |
* para las operaciones sobre geometrías. |
|
7 |
* This class is a default parameter container for geometry operation.<br> |
|
9 | 8 |
* |
10 |
* Normalmente cada GeometryOperation deberá extender esta clase |
|
11 |
* e identificar los parámetros mediante getters/setters. |
|
9 |
* Normally every GeometryOperation will extend this class and identify |
|
10 |
* its parameters publicly with getters/setters |
|
11 |
* |
|
12 |
* For those operations that need high performance, parameters should be declared as class |
|
13 |
* members instead of using the setAttribute/getAttribute mechanism. This way you avoid a hash |
|
14 |
* and a cast operation. |
|
12 | 15 |
* |
13 |
* Para aquellas operaciones que requieran eficiencia, se deberá |
|
14 |
* declarar los parámetros de la operación como miembros de la clase |
|
15 |
* en vez de usar el mecanismo por defecto (getAttribute/setAttribute), |
|
16 |
* de este modo se evita el acceso <i>hash</i> y el <i>cast</i> posterior. |
|
17 |
* |
|
18 | 16 |
* @author jyarza |
19 | 17 |
* |
20 | 18 |
*/ |
... | ... | |
22 | 20 |
|
23 | 21 |
private Map ctx = new HashMap(); |
24 | 22 |
|
23 |
/** |
|
24 |
* Returns an attribute given its name. |
|
25 |
* If it does not exist returns <code>null</code> |
|
26 |
* @param name |
|
27 |
* @return attribute |
|
28 |
*/ |
|
25 | 29 |
public Object getAttribute(String name) { |
26 | 30 |
return ctx.get(name); |
27 | 31 |
} |
28 | 32 |
|
33 |
/** |
|
34 |
* Sets an attribute |
|
35 |
* @param name |
|
36 |
* @param value |
|
37 |
*/ |
|
29 | 38 |
public void setAttribute(String name, Object value) { |
30 | 39 |
ctx.put(name, value); |
31 | 40 |
} |
Also available in: Unified diff