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 DrillDownDefinitions.
028: *
029: * @version $Revision$ $Date$
030: */
031: public class DrillDownDefinitions implements java.io.Serializable {
032:
033: //--------------------------/
034: //- Class/Member Variables -/
035: //--------------------------/
036:
037: /**
038: * Field _drillDownDefinitionList
039: */
040: private java.util.Vector _drillDownDefinitionList;
041:
042: //----------------/
043: //- Constructors -/
044: //----------------/
045:
046: public DrillDownDefinitions() {
047: super ();
048: _drillDownDefinitionList = new Vector();
049: } //-- com.calipso.reportgenerator.reportdefinitions.DrillDownDefinitions()
050:
051: //-----------/
052: //- Methods -/
053: //-----------/
054:
055: /**
056: * Method addDrillDownDefinition
057: *
058: * @param vDrillDownDefinition
059: */
060: public void addDrillDownDefinition(
061: com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition vDrillDownDefinition)
062: throws java.lang.IndexOutOfBoundsException {
063: _drillDownDefinitionList.addElement(vDrillDownDefinition);
064: } //-- void addDrillDownDefinition(com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition)
065:
066: /**
067: * Method addDrillDownDefinition
068: *
069: * @param index
070: * @param vDrillDownDefinition
071: */
072: public void addDrillDownDefinition(
073: int index,
074: com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition vDrillDownDefinition)
075: throws java.lang.IndexOutOfBoundsException {
076: _drillDownDefinitionList.insertElementAt(vDrillDownDefinition,
077: index);
078: } //-- void addDrillDownDefinition(int, com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition)
079:
080: /**
081: * Method enumerateDrillDownDefinition
082: */
083: public java.util.Enumeration enumerateDrillDownDefinition() {
084: return _drillDownDefinitionList.elements();
085: } //-- java.util.Enumeration enumerateDrillDownDefinition()
086:
087: /**
088: * Method getDrillDownDefinition
089: *
090: * @param index
091: */
092: public com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition getDrillDownDefinition(
093: int index) throws java.lang.IndexOutOfBoundsException {
094: //-- check bounds for index
095: if ((index < 0) || (index > _drillDownDefinitionList.size())) {
096: throw new IndexOutOfBoundsException();
097: }
098:
099: return (com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition) _drillDownDefinitionList
100: .elementAt(index);
101: } //-- com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition getDrillDownDefinition(int)
102:
103: /**
104: * Method getDrillDownDefinition
105: */
106: public com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition[] getDrillDownDefinition() {
107: int size = _drillDownDefinitionList.size();
108: com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition[] mArray = new com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition[size];
109: for (int index = 0; index < size; index++) {
110: mArray[index] = (com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition) _drillDownDefinitionList
111: .elementAt(index);
112: }
113: return mArray;
114: } //-- com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition[] getDrillDownDefinition()
115:
116: /**
117: * Method getDrillDownDefinitionCount
118: */
119: public int getDrillDownDefinitionCount() {
120: return _drillDownDefinitionList.size();
121: } //-- int getDrillDownDefinitionCount()
122:
123: /**
124: * Method isValid
125: */
126: public boolean isValid() {
127: try {
128: validate();
129: } catch (org.exolab.castor.xml.ValidationException vex) {
130: return false;
131: }
132: return true;
133: } //-- boolean isValid()
134:
135: /**
136: * Method marshal
137: *
138: * @param out
139: */
140: public void marshal(java.io.Writer out)
141: throws org.exolab.castor.xml.MarshalException,
142: org.exolab.castor.xml.ValidationException {
143:
144: Marshaller.marshal(this , out);
145: } //-- void marshal(java.io.Writer)
146:
147: /**
148: * Method marshal
149: *
150: * @param handler
151: */
152: public void marshal(org.xml.sax.ContentHandler handler)
153: throws java.io.IOException,
154: org.exolab.castor.xml.MarshalException,
155: org.exolab.castor.xml.ValidationException {
156:
157: Marshaller.marshal(this , handler);
158: } //-- void marshal(org.xml.sax.ContentHandler)
159:
160: /**
161: * Method removeAllDrillDownDefinition
162: */
163: public void removeAllDrillDownDefinition() {
164: _drillDownDefinitionList.removeAllElements();
165: } //-- void removeAllDrillDownDefinition()
166:
167: /**
168: * Method removeDrillDownDefinition
169: *
170: * @param index
171: */
172: public com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition removeDrillDownDefinition(
173: int index) {
174: java.lang.Object obj = _drillDownDefinitionList
175: .elementAt(index);
176: _drillDownDefinitionList.removeElementAt(index);
177: return (com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition) obj;
178: } //-- com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition removeDrillDownDefinition(int)
179:
180: /**
181: * Method setDrillDownDefinition
182: *
183: * @param index
184: * @param vDrillDownDefinition
185: */
186: public void setDrillDownDefinition(
187: int index,
188: com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition vDrillDownDefinition)
189: throws java.lang.IndexOutOfBoundsException {
190: //-- check bounds for index
191: if ((index < 0) || (index > _drillDownDefinitionList.size())) {
192: throw new IndexOutOfBoundsException();
193: }
194: _drillDownDefinitionList.setElementAt(vDrillDownDefinition,
195: index);
196: } //-- void setDrillDownDefinition(int, com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition)
197:
198: /**
199: * Method setDrillDownDefinition
200: *
201: * @param drillDownDefinitionArray
202: */
203: public void setDrillDownDefinition(
204: com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition[] drillDownDefinitionArray) {
205: //-- copy array
206: _drillDownDefinitionList.removeAllElements();
207: for (int i = 0; i < drillDownDefinitionArray.length; i++) {
208: _drillDownDefinitionList
209: .addElement(drillDownDefinitionArray[i]);
210: }
211: } //-- void setDrillDownDefinition(com.calipso.reportgenerator.reportdefinitions.DrillDownDefinition)
212:
213: /**
214: * Method unmarshal
215: *
216: * @param reader
217: */
218: public static com.calipso.reportgenerator.reportdefinitions.DrillDownDefinitions unmarshal(
219: java.io.Reader reader)
220: throws org.exolab.castor.xml.MarshalException,
221: org.exolab.castor.xml.ValidationException {
222: return (com.calipso.reportgenerator.reportdefinitions.DrillDownDefinitions) Unmarshaller
223: .unmarshal(
224: com.calipso.reportgenerator.reportdefinitions.DrillDownDefinitions.class,
225: reader);
226: } //-- com.calipso.reportgenerator.reportdefinitions.DrillDownDefinitions unmarshal(java.io.Reader)
227:
228: /**
229: * Method validate
230: */
231: public void validate()
232: throws org.exolab.castor.xml.ValidationException {
233: org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
234: validator.validate(this );
235: } //-- void validate()
236:
237: }
|