2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class DoubleMatrix implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
35 * keeps track of state for field: _rows
37 private boolean _has_rows;
45 * keeps track of state for field: _columns
47 private boolean _has_columns;
52 private java.util.Vector _rowList;
57 private jalview.schemabinding.version2.D _d;
62 private jalview.schemabinding.version2.E _e;
71 this._rowList = new java.util.Vector();
82 * @throws java.lang.IndexOutOfBoundsException
83 * if the index given is outside the bounds of the collection
85 public void addRow(final jalview.schemabinding.version2.Row vRow)
86 throws java.lang.IndexOutOfBoundsException
88 this._rowList.addElement(vRow);
96 * @throws java.lang.IndexOutOfBoundsException
97 * if the index given is outside the bounds of the collection
99 public void addRow(final int index,
100 final jalview.schemabinding.version2.Row vRow)
101 throws java.lang.IndexOutOfBoundsException
103 this._rowList.add(index, vRow);
108 public void deleteColumns()
110 this._has_columns = false;
115 public void deleteRows()
117 this._has_rows = false;
121 * Method enumerateRow.
123 * @return an Enumeration over all jalview.schemabinding.version2.Row elements
125 public java.util.Enumeration enumerateRow()
127 return this._rowList.elements();
131 * Returns the value of field 'columns'.
133 * @return the value of field 'Columns'.
135 public int getColumns()
137 return this._columns;
141 * Returns the value of field 'd'.
143 * @return the value of field 'D'.
145 public jalview.schemabinding.version2.D getD()
151 * Returns the value of field 'e'.
153 * @return the value of field 'E'.
155 public jalview.schemabinding.version2.E getE()
164 * @throws java.lang.IndexOutOfBoundsException
165 * if the index given is outside the bounds of the collection
166 * @return the value of the jalview.schemabinding.version2.Row at the given
169 public jalview.schemabinding.version2.Row getRow(final int index)
170 throws java.lang.IndexOutOfBoundsException
172 // check bounds for index
173 if (index < 0 || index >= this._rowList.size())
175 throw new IndexOutOfBoundsException("getRow: Index value '" + index
176 + "' not in range [0.." + (this._rowList.size() - 1) + "]");
179 return (jalview.schemabinding.version2.Row) _rowList.get(index);
183 * Method getRow.Returns the contents of the collection in an Array.
185 * Note: Just in case the collection contents are changing in another thread,
186 * we pass a 0-length Array of the correct type into the API call. This way we
187 * <i>know</i> that the Array returned is of exactly the correct length.
189 * @return this collection as an Array
191 public jalview.schemabinding.version2.Row[] getRow()
193 jalview.schemabinding.version2.Row[] array = new jalview.schemabinding.version2.Row[0];
194 return (jalview.schemabinding.version2.Row[]) this._rowList
199 * Method getRowCount.
201 * @return the size of this collection
203 public int getRowCount()
205 return this._rowList.size();
209 * Returns the value of field 'rows'.
211 * @return the value of field 'Rows'.
221 * @return true if at least one Columns has been added
223 public boolean hasColumns()
225 return this._has_columns;
231 * @return true if at least one Rows has been added
233 public boolean hasRows()
235 return this._has_rows;
241 * @return true if this object is valid according to the schema
243 public boolean isValid()
248 } catch (org.exolab.castor.xml.ValidationException vex)
259 * @throws org.exolab.castor.xml.MarshalException
260 * if object is null or if any SAXException is thrown during
262 * @throws org.exolab.castor.xml.ValidationException
263 * if this object is an invalid instance according to the schema
265 public void marshal(final java.io.Writer out)
266 throws org.exolab.castor.xml.MarshalException,
267 org.exolab.castor.xml.ValidationException
269 Marshaller.marshal(this, out);
276 * @throws java.io.IOException
277 * if an IOException occurs during marshaling
278 * @throws org.exolab.castor.xml.ValidationException
279 * if this object is an invalid instance according to the schema
280 * @throws org.exolab.castor.xml.MarshalException
281 * if object is null or if any SAXException is thrown during
284 public void marshal(final org.xml.sax.ContentHandler handler)
285 throws java.io.IOException,
286 org.exolab.castor.xml.MarshalException,
287 org.exolab.castor.xml.ValidationException
289 Marshaller.marshal(this, handler);
294 public void removeAllRow()
296 this._rowList.clear();
303 * @return true if the object was removed from the collection.
305 public boolean removeRow(final jalview.schemabinding.version2.Row vRow)
307 boolean removed = _rowList.remove(vRow);
312 * Method removeRowAt.
315 * @return the element removed from the collection
317 public jalview.schemabinding.version2.Row removeRowAt(final int index)
319 java.lang.Object obj = this._rowList.remove(index);
320 return (jalview.schemabinding.version2.Row) obj;
324 * Sets the value of field 'columns'.
327 * the value of field 'columns'.
329 public void setColumns(final int columns)
331 this._columns = columns;
332 this._has_columns = true;
336 * Sets the value of field 'd'.
339 * the value of field 'd'.
341 public void setD(final jalview.schemabinding.version2.D d)
347 * Sets the value of field 'e'.
350 * the value of field 'e'.
352 public void setE(final jalview.schemabinding.version2.E e)
362 * @throws java.lang.IndexOutOfBoundsException
363 * if the index given is outside the bounds of the collection
365 public void setRow(final int index,
366 final jalview.schemabinding.version2.Row vRow)
367 throws java.lang.IndexOutOfBoundsException
369 // check bounds for index
370 if (index < 0 || index >= this._rowList.size())
372 throw new IndexOutOfBoundsException("setRow: Index value '" + index
373 + "' not in range [0.." + (this._rowList.size() - 1) + "]");
376 this._rowList.set(index, vRow);
384 public void setRow(final jalview.schemabinding.version2.Row[] vRowArray)
389 for (int i = 0; i < vRowArray.length; i++)
391 this._rowList.add(vRowArray[i]);
396 * Sets the value of field 'rows'.
399 * the value of field 'rows'.
401 public void setRows(final int rows)
404 this._has_rows = true;
411 * @throws org.exolab.castor.xml.MarshalException
412 * if object is null or if any SAXException is thrown during
414 * @throws org.exolab.castor.xml.ValidationException
415 * if this object is an invalid instance according to the schema
416 * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
418 public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
419 final java.io.Reader reader)
420 throws org.exolab.castor.xml.MarshalException,
421 org.exolab.castor.xml.ValidationException
423 return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
424 .unmarshal(jalview.schemabinding.version2.DoubleMatrix.class,
431 * @throws org.exolab.castor.xml.ValidationException
432 * if this object is an invalid instance according to the schema
434 public void validate() throws org.exolab.castor.xml.ValidationException
436 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
437 validator.validate(this);