001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.11
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011public class Dimensions extends SBase {
012   private long swigCPtr;
013
014   protected Dimensions(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.Dimensions_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(Dimensions obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (Dimensions obj)
026   {
027     long ptr = 0;
028
029     if (obj != null)
030     {
031       ptr             = obj.swigCPtr;
032       obj.swigCMemOwn = false;
033     }
034
035     return ptr;
036   }
037
038  protected void finalize() {
039    delete();
040  }
041
042  public synchronized void delete() {
043    if (swigCPtr != 0) {
044      if (swigCMemOwn) {
045        swigCMemOwn = false;
046        libsbmlJNI.delete_Dimensions(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public Dimensions(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
054    this(libsbmlJNI.new_Dimensions__SWIG_0(level, version, pkgVersion), true);
055  }
056
057  public Dimensions(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
058    this(libsbmlJNI.new_Dimensions__SWIG_1(level, version), true);
059  }
060
061  public Dimensions(long level) throws org.sbml.libsbml.SBMLConstructorException {
062    this(libsbmlJNI.new_Dimensions__SWIG_2(level), true);
063  }
064
065  public Dimensions() throws org.sbml.libsbml.SBMLConstructorException {
066    this(libsbmlJNI.new_Dimensions__SWIG_3(), true);
067  }
068
069  public Dimensions(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
070    this(libsbmlJNI.new_Dimensions__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
071  }
072
073  public Dimensions(Dimensions orig) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_Dimensions__SWIG_5(Dimensions.getCPtr(orig), orig), true);
075  }
076
077  public Dimensions(LayoutPkgNamespaces layoutns, double w, double h, double d) throws org.sbml.libsbml.SBMLConstructorException {
078    this(libsbmlJNI.new_Dimensions__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, w, h, d), true);
079  }
080
081  public Dimensions(LayoutPkgNamespaces layoutns, double w, double h) throws org.sbml.libsbml.SBMLConstructorException {
082    this(libsbmlJNI.new_Dimensions__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, w, h), true);
083  }
084
085  public Dimensions(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
086    this(libsbmlJNI.new_Dimensions__SWIG_8(XMLNode.getCPtr(node), node, l2version), true);
087  }
088
089  public Dimensions(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
090    this(libsbmlJNI.new_Dimensions__SWIG_9(XMLNode.getCPtr(node), node), true);
091  }
092
093  public double width() {
094    return libsbmlJNI.Dimensions_width(swigCPtr, this);
095  }
096
097  public double height() {
098    return libsbmlJNI.Dimensions_height(swigCPtr, this);
099  }
100
101  public double depth() {
102    return libsbmlJNI.Dimensions_depth(swigCPtr, this);
103  }
104
105  public double getWidth() {
106    return libsbmlJNI.Dimensions_getWidth(swigCPtr, this);
107  }
108
109  public double getHeight() {
110    return libsbmlJNI.Dimensions_getHeight(swigCPtr, this);
111  }
112
113  public double getDepth() {
114    return libsbmlJNI.Dimensions_getDepth(swigCPtr, this);
115  }
116
117  public void setWidth(double w) {
118    libsbmlJNI.Dimensions_setWidth(swigCPtr, this, w);
119  }
120
121  public void setHeight(double h) {
122    libsbmlJNI.Dimensions_setHeight(swigCPtr, this, h);
123  }
124
125  public void setDepth(double d) {
126    libsbmlJNI.Dimensions_setDepth(swigCPtr, this, d);
127  }
128
129  public void setBounds(double w, double h, double d) {
130    libsbmlJNI.Dimensions_setBounds__SWIG_0(swigCPtr, this, w, h, d);
131  }
132
133  public void setBounds(double w, double h) {
134    libsbmlJNI.Dimensions_setBounds__SWIG_1(swigCPtr, this, w, h);
135  }
136
137  public void initDefaults() {
138    libsbmlJNI.Dimensions_initDefaults(swigCPtr, this);
139  }
140
141  
142/**
143   * Returns the value of the 'metaid' attribute of this object.
144   * <p>
145   * The optional attribute named 'metaid', present on every major SBML
146   * component type, is for supporting metadata annotations using RDF
147   * (Resource Description Format).  The attribute value has the data type
148   * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML
149   * identifier type, which means each 'metaid' value must be globally
150   * unique within an SBML file.  (Importantly, this uniqueness criterion
151   * applies across any attribute with type <a
152   * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the
153   * 'metaid' attribute used by SBML&mdash;something to be aware of if your
154   * application-specific XML content inside the 'annotation' subelement
155   * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.)
156   * The 'metaid' value serves to identify a model
157   * component for purposes such as referencing that component from
158   * metadata placed within 'annotation' subelements.
159   * <p>
160   * @return the meta-identifier of this SBML object, as a string.
161   * <p>
162   * @see #isSetMetaId()
163   * @see #setMetaId(String metaid)
164   * @internal
165   */ public
166 String getId() {
167    return libsbmlJNI.Dimensions_getId(swigCPtr, this);
168  }
169
170  
171/**
172   * Predicate returning <code>true</code> if this object's 'metaid' attribute is set.
173   * <p>
174   * The optional attribute named 'metaid', present on every major SBML
175   * component type, is for supporting metadata annotations using RDF
176   * (Resource Description Format). The attribute value has the data type
177   * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML
178   * identifier type, which means each 'metaid' value must be globally
179   * unique within an SBML file.  (Importantly, this uniqueness criterion
180   * applies across any attribute with type <a
181   * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the
182   * 'metaid' attribute used by SBML&mdash;something to be aware of if your
183   * application-specific XML content inside the 'annotation' subelement
184   * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.)
185   * The 'metaid' value serves to identify a model component for purposes
186   * such as referencing that component from metadata placed within
187   * 'annotation' subelements.
188   * <p>
189   * @return <code>true</code> if the 'metaid' attribute of this SBML object is
190   * set, <code>false</code> otherwise.
191   * <p>
192   * @see #getMetaId()
193   * @see #setMetaId(String metaid)
194   * @internal
195   */ public
196 boolean isSetId() {
197    return libsbmlJNI.Dimensions_isSetId(swigCPtr, this);
198  }
199
200  
201/**
202   * Predicate returning <code>true</code> if this
203   * object has a {@link ModelHistory} object attached to it.
204   * <p>
205   * @return <code>true</code> if the {@link ModelHistory} of this object is set, 
206   * <code>false</code> otherwise.
207   * <p>
208   * @note In SBML Level&nbsp;2, model history annotations were only
209   * permitted on the {@link Model} element.  In SBML Level&nbsp;3, they are
210   * permitted on all SBML components derived from {@link SBase}.
211   * @internal
212   */ public
213 int setId(String id) {
214    return libsbmlJNI.Dimensions_setId(swigCPtr, this, id);
215  }
216
217  
218/**
219   * Unsets the value of the 'id' attribute of this SBML object.
220   * <p>
221   * Most (but not all) objects in SBML include two common attributes: 'id'
222   * and 'name'.  The identifier given by an object's 'id' attribute value
223   * is used to identify the object within the SBML model definition.
224   * Other objects can refer to the component using this identifier.  The
225   * data type of 'id' is always either <code>Sid</code> or
226   * <code>UnitSId</code>, depending on the object in question.  Both
227   * data types are defined as follows:
228   * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
229   *   letter .= 'a'..'z','A'..'Z'
230   *   digit  .= '0'..'9'
231   *   idChar .= letter | digit | '_'
232   *   SId    .= ( letter | '_' ) idChar*
233   * </pre>
234   * <p>
235   * The equality of <code>SId</code> and <code>UnitSId</code> type values
236   * in SBML is determined by an exact character sequence match; i.e.,
237   * comparisons of these identifiers must be performed in a case-sensitive
238   * manner.  This applies to all uses of <code>SId</code> and
239   * <code>UnitSId</code>.
240   * <p>
241   * @return integer value indicating success/failure of the
242   * function.  The possible values returned by this function are:
243   * <ul>
244   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
245   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
246   * </ul>
247   */ public
248 int unsetId() {
249    return libsbmlJNI.Dimensions_unsetId(swigCPtr, this);
250  }
251
252  
253/**
254   * Returns the XML element name of this object.
255   * <p>
256   * This is overridden by subclasses to return a string appropriate to the
257   * SBML component.  For example, {@link Model} defines it as returning 
258   * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>,
259   * and so on.
260   */ public
261 String getElementName() {
262    return libsbmlJNI.Dimensions_getElementName(swigCPtr, this);
263  }
264
265  
266/**
267   * Creates and returns a deep copy of this {@link SBase} object.
268   * <p>
269   * @return a (deep) copy of this {@link SBase} object.
270   */ public
271 Dimensions cloneObject() {
272    long cPtr = libsbmlJNI.Dimensions_cloneObject(swigCPtr, this);
273    return (cPtr == 0) ? null : new Dimensions(cPtr, true);
274  }
275
276  
277/**
278   * Returns the libSBML type code for this object.
279   * <p>
280   * This method may return the type code of this SBML object, or it may
281   * return {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}.  This
282   * is because subclasses of {@link SBase} are not required to implement this
283   * method to return a type code.  This method is meant primarily for the
284   * LibSBML C interface, in which class and subclass information is not
285   * readily available.
286   * <p>
287   * @return the SBML object type code
288   * of this SBML object or
289   * {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default).
290   * <p>
291   * @see #getElementName()
292   * @see #getPackageName()
293   */ public
294 int getTypeCode() {
295    return libsbmlJNI.Dimensions_getTypeCode(swigCPtr, this);
296  }
297
298  public XMLNode toXML() {
299    return new XMLNode(libsbmlJNI.Dimensions_toXML(swigCPtr, this), true);
300  }
301
302}