001: /*
002: * This class was automatically generated with
003: * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
004: * Schema.
005: * $Id$
006: */
007:
008: package com.calipso.reportgenerator.reportdefinitions;
009:
010: //---------------------------------/
011: //- Imported classes and packages -/
012: //---------------------------------/
013:
014: import java.io.IOException;
015: import java.io.Reader;
016: import java.io.Serializable;
017: import java.io.Writer;
018: import java.util.Enumeration;
019: import java.util.Vector;
020: import org.exolab.castor.xml.MarshalException;
021: import org.exolab.castor.xml.Marshaller;
022: import org.exolab.castor.xml.Unmarshaller;
023: import org.exolab.castor.xml.ValidationException;
024: import org.xml.sax.ContentHandler;
025:
026: /**
027: * Class DimensionSourceDefinitions.
028: *
029: * @version $Revision$ $Date$
030: */
031: public class DimensionSourceDefinitions implements java.io.Serializable {
032:
033: //--------------------------/
034: //- Class/Member Variables -/
035: //--------------------------/
036:
037: /**
038: * Field _dimensionSourceDefinitionList
039: */
040: private java.util.Vector _dimensionSourceDefinitionList;
041:
042: //----------------/
043: //- Constructors -/
044: //----------------/
045:
046: public DimensionSourceDefinitions() {
047: super ();
048: _dimensionSourceDefinitionList = new Vector();
049: } //-- com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinitions()
050:
051: //-----------/
052: //- Methods -/
053: //-----------/
054:
055: /**
056: * Method addDimensionSourceDefinition
057: *
058: * @param vDimensionSourceDefinition
059: */
060: public void addDimensionSourceDefinition(
061: com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition vDimensionSourceDefinition)
062: throws java.lang.IndexOutOfBoundsException {
063: _dimensionSourceDefinitionList
064: .addElement(vDimensionSourceDefinition);
065: } //-- void addDimensionSourceDefinition(com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition)
066:
067: /**
068: * Method addDimensionSourceDefinition
069: *
070: * @param index
071: * @param vDimensionSourceDefinition
072: */
073: public void addDimensionSourceDefinition(
074: int index,
075: com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition vDimensionSourceDefinition)
076: throws java.lang.IndexOutOfBoundsException {
077: _dimensionSourceDefinitionList.insertElementAt(
078: vDimensionSourceDefinition, index);
079: } //-- void addDimensionSourceDefinition(int, com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition)
080:
081: /**
082: * Method enumerateDimensionSourceDefinition
083: */
084: public java.util.Enumeration enumerateDimensionSourceDefinition() {
085: return _dimensionSourceDefinitionList.elements();
086: } //-- java.util.Enumeration enumerateDimensionSourceDefinition()
087:
088: /**
089: * Method getDimensionSourceDefinition
090: *
091: * @param index
092: */
093: public com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition getDimensionSourceDefinition(
094: int index) throws java.lang.IndexOutOfBoundsException {
095: //-- check bounds for index
096: if ((index < 0)
097: || (index > _dimensionSourceDefinitionList.size())) {
098: throw new IndexOutOfBoundsException();
099: }
100:
101: return (com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition) _dimensionSourceDefinitionList
102: .elementAt(index);
103: } //-- com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition getDimensionSourceDefinition(int)
104:
105: /**
106: * Method getDimensionSourceDefinition
107: */
108: public com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition[] getDimensionSourceDefinition() {
109: int size = _dimensionSourceDefinitionList.size();
110: com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition[] mArray = new com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition[size];
111: for (int index = 0; index < size; index++) {
112: mArray[index] = (com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition) _dimensionSourceDefinitionList
113: .elementAt(index);
114: }
115: return mArray;
116: } //-- com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition[] getDimensionSourceDefinition()
117:
118: /**
119: * Method getDimensionSourceDefinitionCount
120: */
121: public int getDimensionSourceDefinitionCount() {
122: return _dimensionSourceDefinitionList.size();
123: } //-- int getDimensionSourceDefinitionCount()
124:
125: /**
126: * Method isValid
127: */
128: public boolean isValid() {
129: try {
130: validate();
131: } catch (org.exolab.castor.xml.ValidationException vex) {
132: return false;
133: }
134: return true;
135: } //-- boolean isValid()
136:
137: /**
138: * Method marshal
139: *
140: * @param out
141: */
142: public void marshal(java.io.Writer out)
143: throws org.exolab.castor.xml.MarshalException,
144: org.exolab.castor.xml.ValidationException {
145:
146: Marshaller.marshal(this , out);
147: } //-- void marshal(java.io.Writer)
148:
149: /**
150: * Method marshal
151: *
152: * @param handler
153: */
154: public void marshal(org.xml.sax.ContentHandler handler)
155: throws java.io.IOException,
156: org.exolab.castor.xml.MarshalException,
157: org.exolab.castor.xml.ValidationException {
158:
159: Marshaller.marshal(this , handler);
160: } //-- void marshal(org.xml.sax.ContentHandler)
161:
162: /**
163: * Method removeAllDimensionSourceDefinition
164: */
165: public void removeAllDimensionSourceDefinition() {
166: _dimensionSourceDefinitionList.removeAllElements();
167: } //-- void removeAllDimensionSourceDefinition()
168:
169: /**
170: * Method removeDimensionSourceDefinition
171: *
172: * @param index
173: */
174: public com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition removeDimensionSourceDefinition(
175: int index) {
176: java.lang.Object obj = _dimensionSourceDefinitionList
177: .elementAt(index);
178: _dimensionSourceDefinitionList.removeElementAt(index);
179: return (com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition) obj;
180: } //-- com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition removeDimensionSourceDefinition(int)
181:
182: /**
183: * Method setDimensionSourceDefinition
184: *
185: * @param index
186: * @param vDimensionSourceDefinition
187: */
188: public void setDimensionSourceDefinition(
189: int index,
190: com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition vDimensionSourceDefinition)
191: throws java.lang.IndexOutOfBoundsException {
192: //-- check bounds for index
193: if ((index < 0)
194: || (index > _dimensionSourceDefinitionList.size())) {
195: throw new IndexOutOfBoundsException();
196: }
197: _dimensionSourceDefinitionList.setElementAt(
198: vDimensionSourceDefinition, index);
199: } //-- void setDimensionSourceDefinition(int, com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition)
200:
201: /**
202: * Method setDimensionSourceDefinition
203: *
204: * @param dimensionSourceDefinitionArray
205: */
206: public void setDimensionSourceDefinition(
207: com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition[] dimensionSourceDefinitionArray) {
208: //-- copy array
209: _dimensionSourceDefinitionList.removeAllElements();
210: for (int i = 0; i < dimensionSourceDefinitionArray.length; i++) {
211: _dimensionSourceDefinitionList
212: .addElement(dimensionSourceDefinitionArray[i]);
213: }
214: } //-- void setDimensionSourceDefinition(com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinition)
215:
216: /**
217: * Method unmarshal
218: *
219: * @param reader
220: */
221: public static com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinitions unmarshal(
222: java.io.Reader reader)
223: throws org.exolab.castor.xml.MarshalException,
224: org.exolab.castor.xml.ValidationException {
225: return (com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinitions) Unmarshaller
226: .unmarshal(
227: com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinitions.class,
228: reader);
229: } //-- com.calipso.reportgenerator.reportdefinitions.DimensionSourceDefinitions unmarshal(java.io.Reader)
230:
231: /**
232: * Method validate
233: */
234: public void validate()
235: throws org.exolab.castor.xml.ValidationException {
236: org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
237: validator.validate(this );
238: } //-- void validate()
239:
240: }
|