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 Point extends SBase {
012   private long swigCPtr;
013
014   protected Point(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.Point_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(Point obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (Point 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_Point(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public Point(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
054    this(libsbmlJNI.new_Point__SWIG_0(level, version, pkgVersion), true);
055  }
056
057  public Point(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
058    this(libsbmlJNI.new_Point__SWIG_1(level, version), true);
059  }
060
061  public Point(long level) throws org.sbml.libsbml.SBMLConstructorException {
062    this(libsbmlJNI.new_Point__SWIG_2(level), true);
063  }
064
065  public Point() throws org.sbml.libsbml.SBMLConstructorException {
066    this(libsbmlJNI.new_Point__SWIG_3(), true);
067  }
068
069  public Point(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
070    this(libsbmlJNI.new_Point__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
071  }
072
073  public Point(Point orig) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_Point__SWIG_5(Point.getCPtr(orig), orig), true);
075  }
076
077  public Point(LayoutPkgNamespaces layoutns, double x, double y, double z) throws org.sbml.libsbml.SBMLConstructorException {
078    this(libsbmlJNI.new_Point__SWIG_6(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x, y, z), true);
079  }
080
081  public Point(LayoutPkgNamespaces layoutns, double x, double y) throws org.sbml.libsbml.SBMLConstructorException {
082    this(libsbmlJNI.new_Point__SWIG_7(LayoutPkgNamespaces.getCPtr(layoutns), layoutns, x, y), true);
083  }
084
085  public Point(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
086    this(libsbmlJNI.new_Point__SWIG_8(XMLNode.getCPtr(node), node, l2version), true);
087  }
088
089  public Point(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
090    this(libsbmlJNI.new_Point__SWIG_9(XMLNode.getCPtr(node), node), true);
091  }
092
093  public double x() {
094    return libsbmlJNI.Point_x(swigCPtr, this);
095  }
096
097  public double y() {
098    return libsbmlJNI.Point_y(swigCPtr, this);
099  }
100
101  public double z() {
102    return libsbmlJNI.Point_z(swigCPtr, this);
103  }
104
105  public double getXOffset() {
106    return libsbmlJNI.Point_getXOffset(swigCPtr, this);
107  }
108
109  public double getYOffset() {
110    return libsbmlJNI.Point_getYOffset(swigCPtr, this);
111  }
112
113  public double getZOffset() {
114    return libsbmlJNI.Point_getZOffset(swigCPtr, this);
115  }
116
117  public void setX(double x) {
118    libsbmlJNI.Point_setX(swigCPtr, this, x);
119  }
120
121  public void setY(double y) {
122    libsbmlJNI.Point_setY(swigCPtr, this, y);
123  }
124
125  public void setZ(double z) {
126    libsbmlJNI.Point_setZ(swigCPtr, this, z);
127  }
128
129  public void setXOffset(double x) {
130    libsbmlJNI.Point_setXOffset(swigCPtr, this, x);
131  }
132
133  public void setYOffset(double y) {
134    libsbmlJNI.Point_setYOffset(swigCPtr, this, y);
135  }
136
137  public void setZOffset(double z) {
138    libsbmlJNI.Point_setZOffset(swigCPtr, this, z);
139  }
140
141  public void setOffsets(double x, double y, double z) {
142    libsbmlJNI.Point_setOffsets__SWIG_0(swigCPtr, this, x, y, z);
143  }
144
145  public void setOffsets(double x, double y) {
146    libsbmlJNI.Point_setOffsets__SWIG_1(swigCPtr, this, x, y);
147  }
148
149  public void initDefaults() {
150    libsbmlJNI.Point_initDefaults(swigCPtr, this);
151  }
152
153  
154/**
155   * Returns the value of the 'metaid' attribute of this object.
156   * <p>
157   * The optional attribute named 'metaid', present on every major SBML
158   * component type, is for supporting metadata annotations using RDF
159   * (Resource Description Format).  The attribute value has the data type
160   * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML
161   * identifier type, which means each 'metaid' value must be globally
162   * unique within an SBML file.  (Importantly, this uniqueness criterion
163   * applies across any attribute with type <a
164   * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the
165   * 'metaid' attribute used by SBML&mdash;something to be aware of if your
166   * application-specific XML content inside the 'annotation' subelement
167   * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.)
168   * The 'metaid' value serves to identify a model
169   * component for purposes such as referencing that component from
170   * metadata placed within 'annotation' subelements.
171   * <p>
172   * @return the meta-identifier of this SBML object, as a string.
173   * <p>
174   * @see #isSetMetaId()
175   * @see #setMetaId(String metaid)
176   * @internal
177   */ public
178 String getId() {
179    return libsbmlJNI.Point_getId(swigCPtr, this);
180  }
181
182  
183/**
184   * Predicate returning <code>true</code> if this object's 'metaid' attribute is set.
185   * <p>
186   * The optional attribute named 'metaid', present on every major SBML
187   * component type, is for supporting metadata annotations using RDF
188   * (Resource Description Format). The attribute value has the data type
189   * <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, the XML
190   * identifier type, which means each 'metaid' value must be globally
191   * unique within an SBML file.  (Importantly, this uniqueness criterion
192   * applies across any attribute with type <a
193   * href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>, not just the
194   * 'metaid' attribute used by SBML&mdash;something to be aware of if your
195   * application-specific XML content inside the 'annotation' subelement
196   * happens to use <a href='http://www.w3.org/TR/REC-xml/#id'>XML ID</a>.)
197   * The 'metaid' value serves to identify a model component for purposes
198   * such as referencing that component from metadata placed within
199   * 'annotation' subelements.
200   * <p>
201   * @return <code>true</code> if the 'metaid' attribute of this SBML object is
202   * set, <code>false</code> otherwise.
203   * <p>
204   * @see #getMetaId()
205   * @see #setMetaId(String metaid)
206   * @internal
207   */ public
208 boolean isSetId() {
209    return libsbmlJNI.Point_isSetId(swigCPtr, this);
210  }
211
212  
213/**
214   * Predicate returning <code>true</code> if this
215   * object has a {@link ModelHistory} object attached to it.
216   * <p>
217   * @return <code>true</code> if the {@link ModelHistory} of this object is set, 
218   * <code>false</code> otherwise.
219   * <p>
220   * @note In SBML Level&nbsp;2, model history annotations were only
221   * permitted on the {@link Model} element.  In SBML Level&nbsp;3, they are
222   * permitted on all SBML components derived from {@link SBase}.
223   * @internal
224   */ public
225 int setId(String id) {
226    return libsbmlJNI.Point_setId(swigCPtr, this, id);
227  }
228
229  
230/**
231   * Unsets the value of the 'id' attribute of this SBML object.
232   * <p>
233   * Most (but not all) objects in SBML include two common attributes: 'id'
234   * and 'name'.  The identifier given by an object's 'id' attribute value
235   * is used to identify the object within the SBML model definition.
236   * Other objects can refer to the component using this identifier.  The
237   * data type of 'id' is always either <code>Sid</code> or
238   * <code>UnitSId</code>, depending on the object in question.  Both
239   * data types are defined as follows:
240   * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
241   *   letter .= 'a'..'z','A'..'Z'
242   *   digit  .= '0'..'9'
243   *   idChar .= letter | digit | '_'
244   *   SId    .= ( letter | '_' ) idChar*
245   * </pre>
246   * <p>
247   * The equality of <code>SId</code> and <code>UnitSId</code> type values
248   * in SBML is determined by an exact character sequence match; i.e.,
249   * comparisons of these identifiers must be performed in a case-sensitive
250   * manner.  This applies to all uses of <code>SId</code> and
251   * <code>UnitSId</code>.
252   * <p>
253   * @return integer value indicating success/failure of the
254   * function.  The possible values returned by this function are:
255   * <ul>
256   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
257   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
258   * </ul>
259   */ public
260 int unsetId() {
261    return libsbmlJNI.Point_unsetId(swigCPtr, this);
262  }
263
264  public void setElementName(String name) {
265    libsbmlJNI.Point_setElementName(swigCPtr, this, name);
266  }
267
268  
269/**
270   * Returns the XML element name of this object.
271   * <p>
272   * This is overridden by subclasses to return a string appropriate to the
273   * SBML component.  For example, {@link Model} defines it as returning 
274   * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>,
275   * and so on.
276   */ public
277 String getElementName() {
278    return libsbmlJNI.Point_getElementName(swigCPtr, this);
279  }
280
281  
282/**
283   * Creates and returns a deep copy of this {@link SBase} object.
284   * <p>
285   * @return a (deep) copy of this {@link SBase} object.
286   */ public
287 Point cloneObject() {
288    long cPtr = libsbmlJNI.Point_cloneObject(swigCPtr, this);
289    return (cPtr == 0) ? null : new Point(cPtr, true);
290  }
291
292  
293/**
294   * Returns the libSBML type code for this object.
295   * <p>
296   * This method may return the type code of this SBML object, or it may
297   * return {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}.  This
298   * is because subclasses of {@link SBase} are not required to implement this
299   * method to return a type code.  This method is meant primarily for the
300   * LibSBML C interface, in which class and subclass information is not
301   * readily available.
302   * <p>
303   * @return the SBML object type code
304   * of this SBML object or
305   * {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default).
306   * <p>
307   * @see #getElementName()
308   * @see #getPackageName()
309   */ public
310 int getTypeCode() {
311    return libsbmlJNI.Point_getTypeCode(swigCPtr, this);
312  }
313
314  public XMLNode toXML(String name) {
315    return new XMLNode(libsbmlJNI.Point_toXML(swigCPtr, this, name), true);
316  }
317
318}