Revision 645
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/dataTypes/DataTypesManager.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
1 | 22 |
package org.gvsig.tools.dataTypes; |
2 | 23 |
|
3 | 24 |
import java.util.Iterator; |
... | ... | |
2 | 23 |
|
3 |
|
|
24 |
/** |
|
25 |
* Manages data types. |
|
26 |
* |
|
27 |
* @author gvSIG Team |
|
28 |
* @version $Id$ |
|
29 |
*/ |
|
4 | 30 |
public interface DataTypesManager { |
5 |
|
|
6 |
public interface Coercion { |
|
7 |
public Object coerce(Object value) throws CoercionException; |
|
8 |
} |
|
9 | 31 |
|
10 |
public DataType get(int type);
|
|
32 |
public interface Coercion {
|
|
11 | 33 |
|
12 |
public boolean isValidType(int type) ; |
|
34 |
public Object coerce(Object value) throws CoercionException; |
|
35 |
} |
|
13 | 36 |
|
14 |
public boolean isObject(int type) ; |
|
15 |
|
|
16 |
public boolean isContainer(int type) ; |
|
17 |
|
|
18 |
public String getTypeName(int type) ; |
|
19 |
|
|
20 |
public int getType(String name) ; |
|
37 |
public DataType get(int type); |
|
21 | 38 |
|
22 |
public Class getDefaultClass(int type) ;
|
|
39 |
public boolean isValidType(int type);
|
|
23 | 40 |
|
24 |
public String getSubtype(int type) ;
|
|
41 |
public boolean isObject(int type);
|
|
25 | 42 |
|
26 |
public int addtype(int type, String subtype, String name, Class defaultClass, Coercion coercion) ;
|
|
43 |
public boolean isContainer(int type);
|
|
27 | 44 |
|
28 |
public Coercion getCoercion(int type) ; |
|
29 |
|
|
30 |
public void setCoercion(int type, Coercion coercion) ; |
|
31 |
|
|
32 |
public Object coerce(int type, Object value) throws CoercionException; |
|
45 |
public String getTypeName(int type); |
|
33 | 46 |
|
47 |
public int getType(String name); |
|
48 |
|
|
49 |
public Class getDefaultClass(int type); |
|
50 |
|
|
51 |
public String getSubtype(int type); |
|
52 |
|
|
53 |
public int addtype(int type, String subtype, String name, |
|
54 |
Class defaultClass, Coercion coercion); |
|
55 |
|
|
56 |
public Coercion getCoercion(int type); |
|
57 |
|
|
58 |
public void setCoercion(int type, Coercion coercion); |
|
59 |
|
|
60 |
public Object coerce(int type, Object value) throws CoercionException; |
|
61 |
|
|
34 | 62 |
public Iterator iterator(); |
35 |
|
|
63 |
|
|
36 | 64 |
} |
Also available in: Unified diff