Statistics
| Revision:

root / branches / v2_0_0_prep / frameworks / _fwAndami / src / org / gvsig / andami / plugins / config / generate / LabelSet.java @ 29593

History | View | Annotate | Download (6.96 KB)

1
/*
2
 * This class was automatically generated with 
3
 * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
4
 * Schema.
5
 * $Id: LabelSet.java 29593 2009-06-29 15:54:31Z jpiera $
6
 */
7

    
8
package org.gvsig.andami.plugins.config.generate;
9

    
10
  //---------------------------------/
11
 //- Imported classes and packages -/
12
//---------------------------------/
13

    
14
import java.io.IOException;
15
import java.io.Reader;
16
import java.io.Serializable;
17
import java.io.Writer;
18
import java.util.Enumeration;
19
import java.util.Vector;
20
import org.exolab.castor.xml.MarshalException;
21
import org.exolab.castor.xml.Marshaller;
22
import org.exolab.castor.xml.Unmarshaller;
23
import org.exolab.castor.xml.ValidationException;
24
import org.xml.sax.ContentHandler;
25

    
26
/**
27
 * Class LabelSet.
28
 * 
29
 * @version $Revision: 29593 $ $Date: 2009-06-29 17:54:31 +0200 (Mon, 29 Jun 2009) $
30
 */
31
public class LabelSet implements java.io.Serializable {
32

    
33

    
34
      //--------------------------/
35
     //- Class/Member Variables -/
36
    //--------------------------/
37

    
38
    /**
39
     * Field _className
40
     */
41
    private java.lang.String _className;
42

    
43
    /**
44
     * Field _labelList
45
     */
46
    private java.util.Vector _labelList;
47

    
48

    
49
      //----------------/
50
     //- Constructors -/
51
    //----------------/
52

    
53
    public LabelSet() {
54
        super();
55
        _labelList = new Vector();
56
    } //-- com.iver.andami.plugins.config.generate.LabelSet()
57

    
58

    
59
      //-----------/
60
     //- Methods -/
61
    //-----------/
62

    
63
    /**
64
     * Method addLabel
65
     * 
66
     * @param vLabel
67
     */
68
    public void addLabel(org.gvsig.andami.plugins.config.generate.Label vLabel)
69
        throws java.lang.IndexOutOfBoundsException
70
    {
71
        _labelList.addElement(vLabel);
72
    } //-- void addLabel(com.iver.andami.plugins.config.generate.Label) 
73

    
74
    /**
75
     * Method addLabel
76
     * 
77
     * @param index
78
     * @param vLabel
79
     */
80
    public void addLabel(int index, org.gvsig.andami.plugins.config.generate.Label vLabel)
81
        throws java.lang.IndexOutOfBoundsException
82
    {
83
        _labelList.insertElementAt(vLabel, index);
84
    } //-- void addLabel(int, com.iver.andami.plugins.config.generate.Label) 
85

    
86
    /**
87
     * Method enumerateLabel
88
     */
89
    public java.util.Enumeration enumerateLabel()
90
    {
91
        return _labelList.elements();
92
    } //-- java.util.Enumeration enumerateLabel() 
93

    
94
    /**
95
     * Returns the value of field 'className'.
96
     * 
97
     * @return the value of field 'className'.
98
     */
99
    public java.lang.String getClassName()
100
    {
101
        return this._className;
102
    } //-- java.lang.String getClassName() 
103

    
104
    /**
105
     * Method getLabel
106
     * 
107
     * @param index
108
     */
109
    public org.gvsig.andami.plugins.config.generate.Label getLabel(int index)
110
        throws java.lang.IndexOutOfBoundsException
111
    {
112
        //-- check bounds for index
113
        if ((index < 0) || (index > _labelList.size())) {
114
            throw new IndexOutOfBoundsException();
115
        }
116
        
117
        return (org.gvsig.andami.plugins.config.generate.Label) _labelList.elementAt(index);
118
    } //-- com.iver.andami.plugins.config.generate.Label getLabel(int) 
119

    
120
    /**
121
     * Method getLabel
122
     */
123
    public org.gvsig.andami.plugins.config.generate.Label[] getLabel()
124
    {
125
        int size = _labelList.size();
126
        org.gvsig.andami.plugins.config.generate.Label[] mArray = new org.gvsig.andami.plugins.config.generate.Label[size];
127
        for (int index = 0; index < size; index++) {
128
            mArray[index] = (org.gvsig.andami.plugins.config.generate.Label) _labelList.elementAt(index);
129
        }
130
        return mArray;
131
    } //-- com.iver.andami.plugins.config.generate.Label[] getLabel() 
132

    
133
    /**
134
     * Method getLabelCount
135
     */
136
    public int getLabelCount()
137
    {
138
        return _labelList.size();
139
    } //-- int getLabelCount() 
140

    
141
    /**
142
     * Method isValid
143
     */
144
    public boolean isValid()
145
    {
146
        try {
147
            validate();
148
        }
149
        catch (org.exolab.castor.xml.ValidationException vex) {
150
            return false;
151
        }
152
        return true;
153
    } //-- boolean isValid() 
154

    
155
    /**
156
     * Method marshal
157
     * 
158
     * @param out
159
     */
160
    public void marshal(java.io.Writer out)
161
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
162
    {
163
        
164
        Marshaller.marshal(this, out);
165
    } //-- void marshal(java.io.Writer) 
166

    
167
    /**
168
     * Method marshal
169
     * 
170
     * @param handler
171
     */
172
    public void marshal(org.xml.sax.ContentHandler handler)
173
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
174
    {
175
        
176
        Marshaller.marshal(this, handler);
177
    } //-- void marshal(org.xml.sax.ContentHandler) 
178

    
179
    /**
180
     * Method removeAllLabel
181
     */
182
    public void removeAllLabel()
183
    {
184
        _labelList.removeAllElements();
185
    } //-- void removeAllLabel() 
186

    
187
    /**
188
     * Method removeLabel
189
     * 
190
     * @param index
191
     */
192
    public org.gvsig.andami.plugins.config.generate.Label removeLabel(int index)
193
    {
194
        java.lang.Object obj = _labelList.elementAt(index);
195
        _labelList.removeElementAt(index);
196
        return (org.gvsig.andami.plugins.config.generate.Label) obj;
197
    } //-- com.iver.andami.plugins.config.generate.Label removeLabel(int) 
198

    
199
    /**
200
     * Sets the value of field 'className'.
201
     * 
202
     * @param className the value of field 'className'.
203
     */
204
    public void setClassName(java.lang.String className)
205
    {
206
        this._className = className;
207
    } //-- void setClassName(java.lang.String) 
208

    
209
    /**
210
     * Method setLabel
211
     * 
212
     * @param index
213
     * @param vLabel
214
     */
215
    public void setLabel(int index, org.gvsig.andami.plugins.config.generate.Label vLabel)
216
        throws java.lang.IndexOutOfBoundsException
217
    {
218
        //-- check bounds for index
219
        if ((index < 0) || (index > _labelList.size())) {
220
            throw new IndexOutOfBoundsException();
221
        }
222
        _labelList.setElementAt(vLabel, index);
223
    } //-- void setLabel(int, com.iver.andami.plugins.config.generate.Label) 
224

    
225
    /**
226
     * Method setLabel
227
     * 
228
     * @param labelArray
229
     */
230
    public void setLabel(org.gvsig.andami.plugins.config.generate.Label[] labelArray)
231
    {
232
        //-- copy array
233
        _labelList.removeAllElements();
234
        for (int i = 0; i < labelArray.length; i++) {
235
            _labelList.addElement(labelArray[i]);
236
        }
237
    } //-- void setLabel(com.iver.andami.plugins.config.generate.Label) 
238

    
239
    /**
240
     * Method unmarshal
241
     * 
242
     * @param reader
243
     */
244
    public static java.lang.Object unmarshal(java.io.Reader reader)
245
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
246
    {
247
        return (org.gvsig.andami.plugins.config.generate.LabelSet) Unmarshaller.unmarshal(org.gvsig.andami.plugins.config.generate.LabelSet.class, reader);
248
    } //-- java.lang.Object unmarshal(java.io.Reader) 
249

    
250
    /**
251
     * Method validate
252
     */
253
    public void validate()
254
        throws org.exolab.castor.xml.ValidationException
255
    {
256
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
257
        validator.validate(this);
258
    } //-- void validate() 
259

    
260
}