001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.10
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
011/** 
012 * <span class="pkg-marker pkg-color-groups"><a href="group__groups.html">groups</a></span>
013 Base extension class for the package.
014 <p>
015 * This is the Groups package extension of the {@link SBMLExtension} class that
016 * every libSBML plug-in must implement in order to implement an
017 * SBML Level&nbsp;3 package.
018 <p>
019 * <p>
020 * The {@link SBMLExtension} class provides methods for managing common attributes of
021 * package extensions (e.g., the SBML package name, the package version, and
022 * more), registration of instantiated plug-in creators to hook into the rest
023 * of libSBML, and initialization/registration of package extensions when the
024 * library code for the package is loaded by libSBML.  {@link SBMLExtension} is an
025 * abstract class that must be extended by each package extension
026 * implementation.
027 */
028
029public class GroupsExtension extends SBMLExtension {
030   private long swigCPtr;
031
032   protected GroupsExtension(long cPtr, boolean cMemoryOwn)
033   {
034     super(libsbmlJNI.GroupsExtension_SWIGUpcast(cPtr), cMemoryOwn);
035     swigCPtr = cPtr;
036   }
037
038   protected static long getCPtr(GroupsExtension obj)
039   {
040     return (obj == null) ? 0 : obj.swigCPtr;
041   }
042
043   protected static long getCPtrAndDisown (GroupsExtension obj)
044   {
045     long ptr = 0;
046
047     if (obj != null)
048     {
049       ptr             = obj.swigCPtr;
050       obj.swigCMemOwn = false;
051     }
052
053     return ptr;
054   }
055
056  protected void finalize() {
057    delete();
058  }
059
060  public synchronized void delete() {
061    if (swigCPtr != 0) {
062      if (swigCMemOwn) {
063        swigCMemOwn = false;
064        libsbmlJNI.delete_GroupsExtension(swigCPtr);
065      }
066      swigCPtr = 0;
067    }
068    super.delete();
069  }
070
071    public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner)
072    {
073        if (cPtr == 0) return null;
074        
075        SBasePlugin sbp = new SBasePlugin(cPtr, false);
076        SBase sb = sbp.getParentSBMLObject();
077        
078        switch( sb.getTypeCode() )
079        {
080            case (int) libsbml.SBML_MODEL:
081                return new GroupsModelPlugin(cPtr,owner);
082            default:
083                return new SBasePlugin(cPtr,owner);
084        }
085    }
086    
087  public SBase DowncastSBase(long cPtr, boolean owner)
088  {
089    if (cPtr == 0) return null;
090
091    SBase sb = new SBase(cPtr, false);
092    switch ( sb.getTypeCode() )
093    {
094      case (int) libsbml.SBML_LIST_OF:
095        String name = sb.getElementName();
096        if (name.equals("listOfGroups"))
097        {
098          return new ListOfGroups(cPtr, owner);
099        }
100        else if (name.equals("listOfMembers"))
101        {
102          return new ListOfMembers(cPtr, owner);
103        }
104
105        return new ListOf(cPtr, owner);
106
107      case (int) libsbml.SBML_GROUPS_GROUP:
108        return new Group(cPtr, owner);
109
110      case (int) libsbml.SBML_GROUPS_MEMBER:
111        return new Member(cPtr, owner);
112
113      default:
114        return new SBase(cPtr, owner);
115    }
116  }
117
118    
119  
120/**
121   * Returns the nickname of the SBML Level&nbsp;3 package implemented by this
122   * libSBML extension.
123   <p>
124   * @return the package nickname, as a string.
125   <p>
126   * 
127   */ public
128 static String getPackageName() {
129    return libsbmlJNI.GroupsExtension_getPackageName();
130  }
131
132  
133/**
134   * Returns the default SBML Level implemented by this libSBML extension.
135   <p>
136   * @return the SBML Level, as a long integereger.
137   <p>
138   * 
139   */ public
140 static long getDefaultLevel() {
141    return libsbmlJNI.GroupsExtension_getDefaultLevel();
142  }
143
144  
145/**
146   * Returns the default SBML Version implemented by this libSBML extension.
147   <p>
148   * @return the Version within the default SBML Level, as a long integereger.
149   <p>
150   * 
151   */ public
152 static long getDefaultVersion() {
153    return libsbmlJNI.GroupsExtension_getDefaultVersion();
154  }
155
156  
157/**
158   * Returns the default version of the SBML Level&nbsp;3 package implemented
159   * by this libSBML extension.
160   <p>
161   * @return the default version number of the SBML Level&nbsp;3 package
162   * definition, as a long integereger.
163   <p>
164   * 
165   */ public
166 static long getDefaultPackageVersion() {
167    return libsbmlJNI.GroupsExtension_getDefaultPackageVersion();
168  }
169
170  
171/**
172   * Returns the XML namespace URI of the SBML Level&nbsp;3 package implemented
173   * by this libSBML extension.
174   <p>
175   * @return the XML namespace, as a string.
176   <p>
177   * 
178   */ public
179 static String getXmlnsL3V1V1() {
180    return libsbmlJNI.GroupsExtension_getXmlnsL3V1V1();
181  }
182
183  
184/**
185   * Creates a new {@link GroupsExtension} instance.
186   */ public
187 GroupsExtension() {
188    this(libsbmlJNI.new_GroupsExtension__SWIG_0(), true);
189  }
190
191  
192/**
193   * Copy constructor for {@link GroupsExtension}.
194   <p>
195   * @param orig the {@link GroupsExtension} instance to copy.
196   */ public
197 GroupsExtension(GroupsExtension orig) {
198    this(libsbmlJNI.new_GroupsExtension__SWIG_1(GroupsExtension.getCPtr(orig), orig), true);
199  }
200
201  
202/**
203   * Creates and returns a deep copy of this {@link GroupsExtension} object.
204   <p>
205   * @return a (deep) copy of this {@link GroupsExtension} object.
206   */ public
207 GroupsExtension cloneObject() {
208    long cPtr = libsbmlJNI.GroupsExtension_cloneObject(swigCPtr, this);
209    return (cPtr == 0) ? null : new GroupsExtension(cPtr, true);
210  }
211
212  
213/**
214   * Returns the name of this SBML Level&nbsp;3 package ('groups').
215   <p>
216   * @return a string representing the name of this package ('groups').
217   */ public
218 String getName() {
219    return libsbmlJNI.GroupsExtension_getName(swigCPtr, this);
220  }
221
222  
223/**
224   * Returns a string representing the SBML XML namespace of this SBML
225   * Level&nbsp;3 package.
226   <p>
227   * The namespace URI constructed by this method corresponds to the
228   * combination of the Level and Version of SBML, and the Version of the SBML
229   * Level&nbsp;3 package. (At the time of this writing, the only SBML Level
230   * that supports packages is Level&nbsp;3, so the value of <code>sbmlLevel</code> is
231   * necessarily always <code>3</code>.)
232   <p>
233   * @param sbmlLevel the level of SBML.
234   <p>
235   * @param sbmlVersion the version of SBML.
236   <p>
237   * @param pkgVersion the version of this package.
238   <p>
239   * @return a string representing the name of this package ('groups').
240   */ public
241 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) {
242    return libsbmlJNI.GroupsExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion);
243  }
244
245  
246/**
247   * Returns the SBML Level for the given URI of this package.
248   <p>
249   * @param uri the string of the URI that represents one of the versions of
250   * the 'groups' package.
251   <p>
252   * @return the SBML Level for the given URI of this package, or <code>0</code> if the
253   * given URI is invalid.
254   */ public
255 long getLevel(String uri) {
256    return libsbmlJNI.GroupsExtension_getLevel(swigCPtr, this, uri);
257  }
258
259  
260/**
261   * Returns the Version within the SBML Level for the given URI of this
262   * package.
263   <p>
264   * @param uri the string of the URI that represents one of the versions of
265   * the 'groups' package.
266   <p>
267   * @return the SBML Version within the SBML Level for the given URI of this
268   * package, or <code>0</code> if the given URI is invalid.
269   */ public
270 long getVersion(String uri) {
271    return libsbmlJNI.GroupsExtension_getVersion(swigCPtr, this, uri);
272  }
273
274  
275/**
276   * Returns the SBML Level&nbsp;3 package version for the given URI of this
277   * package.
278   <p>
279   * @param uri the string of the URI that represents one of the versions of
280   * the 'groups' package.
281   <p>
282   * @return the version of the SBML Level&nbsp;3 package for the given URI of
283   * this package, or <code>0</code> if the given URI is invalid.
284   */ public
285 long getPackageVersion(String uri) {
286    return libsbmlJNI.GroupsExtension_getPackageVersion(swigCPtr, this, uri);
287  }
288
289  
290/**
291   * Returns a {@link GroupsPkgNamespaces} object.
292   <p>
293   * @param uri the string of the URI that represents one of the versions of
294   * the 'groups' package.
295   <p>
296   * @return {@link GroupsPkgNamespaces} object corresponding to the given URI of this
297   * package, or <code>null</code> if the given URI is not defined in the 'groups'
298   * package.
299   */ public
300 SBMLNamespaces getSBMLExtensionNamespaces(String uri) {
301  return libsbml.DowncastSBMLNamespaces(libsbmlJNI.GroupsExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false);
302}
303
304  
305/**
306   * Returns a string describing the type code of the &ldquo;groups&rdquo;
307   * package.
308   <p>
309   * @param typeCode a libSBML type code defined by the libSBML extension
310   * implementing support for the SBML Level&nbsp;3 &ldquo;groups&rdquo;
311   * package.
312   <p>
313   * @return a text string representing the type code given by <code>typeCode</code>. If
314   * the type code is unrecognized for this implementation of the libSBML
315   * &ldquo;groups&rdquo; package, the string returned will be <code>'(Unknown
316   * SBML Groups Type)'</code>.
317   */ public
318 String getStringFromTypeCode(int typeCode) {
319    return libsbmlJNI.GroupsExtension_getStringFromTypeCode(swigCPtr, this, typeCode);
320  }
321
322  
323/** * @internal */ public
324 SWIGTYPE_p_packageErrorTableEntry getErrorTable(long index) {
325    return new SWIGTYPE_p_packageErrorTableEntry(libsbmlJNI.GroupsExtension_getErrorTable(swigCPtr, this, index), true);
326  }
327
328  
329/** * @internal */ public
330 long getErrorTableIndex(long errorId) {
331    return libsbmlJNI.GroupsExtension_getErrorTableIndex(swigCPtr, this, errorId);
332  }
333
334  
335/** * @internal */ public
336 long getErrorIdOffset() {
337    return libsbmlJNI.GroupsExtension_getErrorIdOffset(swigCPtr, this);
338  }
339
340  
341/** * @internal */ public
342 static void init() {
343    libsbmlJNI.GroupsExtension_init();
344  }
345
346}