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;
61 this._rowList = new java.util.Vector();
72 * @throws java.lang.IndexOutOfBoundsException
73 * if the index given is outside the bounds of the collection
75 public void addRow(final jalview.schemabinding.version2.Row vRow)
76 throws java.lang.IndexOutOfBoundsException
78 this._rowList.addElement(vRow);
86 * @throws java.lang.IndexOutOfBoundsException
87 * if the index given is outside the bounds of the collection
89 public void addRow(final int index,
90 final jalview.schemabinding.version2.Row vRow)
91 throws java.lang.IndexOutOfBoundsException
93 this._rowList.add(index, vRow);
98 public void deleteColumns()
100 this._has_columns = false;
105 public void deleteRows()
107 this._has_rows = false;
111 * Method enumerateRow.
113 * @return an Enumeration over all jalview.schemabinding.version2.Row elements
115 public java.util.Enumeration enumerateRow()
117 return this._rowList.elements();
121 * Returns the value of field 'columns'.
123 * @return the value of field 'Columns'.
125 public int getColumns()
127 return this._columns;
134 * @throws java.lang.IndexOutOfBoundsException
135 * if the index given is outside the bounds of the collection
136 * @return the value of the jalview.schemabinding.version2.Row at the given
139 public jalview.schemabinding.version2.Row getRow(final int index)
140 throws java.lang.IndexOutOfBoundsException
142 // check bounds for index
143 if (index < 0 || index >= this._rowList.size())
145 throw new IndexOutOfBoundsException("getRow: Index value '" + index
146 + "' not in range [0.." + (this._rowList.size() - 1) + "]");
149 return (jalview.schemabinding.version2.Row) _rowList.get(index);
153 * Method getRow.Returns the contents of the collection in an Array.
155 * Note: Just in case the collection contents are changing in another thread,
156 * we pass a 0-length Array of the correct type into the API call. This way we
157 * <i>know</i> that the Array returned is of exactly the correct length.
159 * @return this collection as an Array
161 public jalview.schemabinding.version2.Row[] getRow()
163 jalview.schemabinding.version2.Row[] array = new jalview.schemabinding.version2.Row[0];
164 return (jalview.schemabinding.version2.Row[]) this._rowList
169 * Method getRowCount.
171 * @return the size of this collection
173 public int getRowCount()
175 return this._rowList.size();
179 * Returns the value of field 'rows'.
181 * @return the value of field 'Rows'.
191 * @return true if at least one Columns has been added
193 public boolean hasColumns()
195 return this._has_columns;
201 * @return true if at least one Rows has been added
203 public boolean hasRows()
205 return this._has_rows;
211 * @return true if this object is valid according to the schema
213 public boolean isValid()
218 } catch (org.exolab.castor.xml.ValidationException vex)
229 * @throws org.exolab.castor.xml.MarshalException
230 * if object is null or if any SAXException is thrown during
232 * @throws org.exolab.castor.xml.ValidationException
233 * if this object is an invalid instance according to the schema
235 public void marshal(final java.io.Writer out)
236 throws org.exolab.castor.xml.MarshalException,
237 org.exolab.castor.xml.ValidationException
239 Marshaller.marshal(this, out);
246 * @throws java.io.IOException
247 * if an IOException occurs during marshaling
248 * @throws org.exolab.castor.xml.ValidationException
249 * if this object is an invalid instance according to the schema
250 * @throws org.exolab.castor.xml.MarshalException
251 * if object is null or if any SAXException is thrown during
254 public void marshal(final org.xml.sax.ContentHandler handler)
255 throws java.io.IOException,
256 org.exolab.castor.xml.MarshalException,
257 org.exolab.castor.xml.ValidationException
259 Marshaller.marshal(this, handler);
264 public void removeAllRow()
266 this._rowList.clear();
273 * @return true if the object was removed from the collection.
275 public boolean removeRow(final jalview.schemabinding.version2.Row vRow)
277 boolean removed = _rowList.remove(vRow);
282 * Method removeRowAt.
285 * @return the element removed from the collection
287 public jalview.schemabinding.version2.Row removeRowAt(final int index)
289 java.lang.Object obj = this._rowList.remove(index);
290 return (jalview.schemabinding.version2.Row) obj;
294 * Sets the value of field 'columns'.
297 * the value of field 'columns'.
299 public void setColumns(final int columns)
301 this._columns = columns;
302 this._has_columns = true;
310 * @throws java.lang.IndexOutOfBoundsException
311 * if the index given is outside the bounds of the collection
313 public void setRow(final int index,
314 final jalview.schemabinding.version2.Row vRow)
315 throws java.lang.IndexOutOfBoundsException
317 // check bounds for index
318 if (index < 0 || index >= this._rowList.size())
320 throw new IndexOutOfBoundsException("setRow: Index value '" + index
321 + "' not in range [0.." + (this._rowList.size() - 1) + "]");
324 this._rowList.set(index, vRow);
332 public void setRow(final jalview.schemabinding.version2.Row[] vRowArray)
337 for (int i = 0; i < vRowArray.length; i++)
339 this._rowList.add(vRowArray[i]);
344 * Sets the value of field 'rows'.
347 * the value of field 'rows'.
349 public void setRows(final int rows)
352 this._has_rows = true;
359 * @throws org.exolab.castor.xml.MarshalException
360 * if object is null or if any SAXException is thrown during
362 * @throws org.exolab.castor.xml.ValidationException
363 * if this object is an invalid instance according to the schema
364 * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
366 public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
367 final java.io.Reader reader)
368 throws org.exolab.castor.xml.MarshalException,
369 org.exolab.castor.xml.ValidationException
371 return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
372 .unmarshal(jalview.schemabinding.version2.DoubleMatrix.class,
379 * @throws org.exolab.castor.xml.ValidationException
380 * if this object is an invalid instance according to the schema
382 public void validate() throws org.exolab.castor.xml.ValidationException
384 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
385 validator.validate(this);