Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / drivers / FieldDescription.java @ 6212

History | View | Annotate | Download (3.59 KB)

1
/*
2
 * Created on 27-oct-2005
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 * 
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 * 
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *  
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 * 
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21
 *  
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 * 
34
 *    or
35
 * 
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 * 
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
package com.iver.cit.gvsig.fmap.drivers;
45

    
46
import com.hardcode.gdbms.engine.values.NullValue;
47
import com.hardcode.gdbms.engine.values.Value;
48

    
49
public class FieldDescription {
50
    /**
51
     * Internal field name.
52
     */
53
    private String fieldName;
54
    private String fieldAlias;
55
    private int fieldType;
56
    private Value defaultValue = new NullValue();
57
    /**
58
     * En campos num?ricos, numero de d?gitos a la izquierda del punto
59
     * En campos de texto, numero de caracteres.
60
     */
61
    private int fieldLength; 
62
    
63
    /**
64
     * En campos num?ricos, numero de d?gitos a la derecha del punto.
65
     */
66
    private int fieldDecimalCount;
67

    
68
    /**
69
     * @return Returns the fieldDecimalCount.
70
     */
71
    public int getFieldDecimalCount() {
72
        return fieldDecimalCount;
73
    }
74

    
75
    /**
76
     * @param fieldDecimalCount The fieldDecimalCount to set.
77
     */
78
    public void setFieldDecimalCount(int fieldDecimalCount) {
79
        this.fieldDecimalCount = fieldDecimalCount;
80
    }
81

    
82
    /**
83
     * @return Returns the fieldLength.
84
     */
85
    public int getFieldLength() {
86
        return fieldLength;
87
    }
88

    
89
    /**
90
     * @param fieldLength The fieldLength to set.
91
     */
92
    public void setFieldLength(int fieldLength) {
93
        this.fieldLength = fieldLength;
94
    }
95

    
96
    /**
97
     * @return Returns the fieldName.
98
     */
99
    public String getFieldName() {
100
        return fieldName;
101
    }
102

    
103
    /**
104
     * @param fieldName The fieldName to set.
105
     */
106
    public void setFieldName(String fieldName) {
107
        this.fieldName = fieldName;
108
        this.fieldAlias = fieldName;
109
    }
110

    
111
    /**
112
     * @return Returns the fieldType.
113
     */
114
    public int getFieldType() {
115
        return fieldType;
116
    }
117

    
118
    /**
119
     * @param fieldType The fieldType to set.
120
     */
121
    public void setFieldType(int fieldType) {
122
        this.fieldType = fieldType;
123
    }
124

    
125
        public String getFieldAlias() {
126
                return fieldAlias;
127
        }
128

    
129
        public void setFieldAlias(String fieldAlias) {
130
                this.fieldAlias = fieldAlias;
131
        }
132
        
133
        public FieldDescription cloneField() {
134
                FieldDescription resul = new FieldDescription();
135
                resul.fieldAlias = fieldAlias;
136
                resul.fieldName = fieldName;
137
                resul.fieldDecimalCount = fieldDecimalCount;
138
                resul.fieldType = fieldType;
139
                return resul;
140
        }
141

    
142
        public Value getDefaultValue() {
143
                return defaultValue;
144
        }
145

    
146
        public void setDefaultValue(Value defaultValue) {
147
                this.defaultValue = defaultValue;
148
        }
149

    
150
}