001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
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 GroupsExtension extends SBMLExtension {
012   private long swigCPtr;
013
014   protected GroupsExtension(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.GroupsExtension_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(GroupsExtension obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (GroupsExtension 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_GroupsExtension(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053    public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner)
054    {
055        if (cPtr == 0) return null;
056        
057        SBasePlugin sbp = new SBasePlugin(cPtr, false);
058        SBase sb = sbp.getParentSBMLObject();
059        
060        switch( sb.getTypeCode() )
061        {
062            case (int) libsbml.SBML_MODEL:
063                return new GroupsModelPlugin(cPtr,owner);
064            default:
065                return new SBasePlugin(cPtr,owner);
066        }
067    }
068    
069    public SBase DowncastSBase(long cPtr, boolean owner)
070    {
071        if (cPtr == 0) return null;
072        
073        SBase sb = new SBase(cPtr, false);
074        switch( sb.getTypeCode() )
075        {
076            case (int) libsbml.SBML_LIST_OF:
077                String name = sb.getElementName();
078                if(name =="listOfMembers")
079                {
080                    return new ListOfMembers(cPtr, owner);
081                }
082                else if(name =="listOfGroups")
083                {
084                    return new ListOfGroups(cPtr, owner);
085                }
086                
087                return new ListOf(cPtr, owner);
088                
089            case (int) libsbml.SBML_GROUPS_MEMBER:
090                return new Member(cPtr, owner);
091
092            case (int) libsbml.SBML_GROUPS_MEMBER_CONSTRAINT:
093                return new MemberConstraint(cPtr, owner);
094
095            case (int) libsbml.SBML_GROUPS_GROUP:
096                return new Group(cPtr, owner);
097                
098            default:
099                return new SBase(cPtr, owner);
100        }
101    }
102    
103    
104  
105/**
106   * Returns the package name of this extension.
107   */ public
108 static String getPackageName() {
109    return libsbmlJNI.GroupsExtension_getPackageName();
110  }
111
112  
113/**
114   * Returns the default SBML Level this extension.
115   */ public
116 static long getDefaultLevel() {
117    return libsbmlJNI.GroupsExtension_getDefaultLevel();
118  }
119
120  
121/**
122   * Returns the default SBML Version this extension.
123   */ public
124 static long getDefaultVersion() {
125    return libsbmlJNI.GroupsExtension_getDefaultVersion();
126  }
127
128  
129/**
130   * Returns the default SBML version this extension.
131   */ public
132 static long getDefaultPackageVersion() {
133    return libsbmlJNI.GroupsExtension_getDefaultPackageVersion();
134  }
135
136  
137/**
138   * Returns URI of supported versions of this package.
139   */ public
140 static String getXmlnsL3V1V1() {
141    return libsbmlJNI.GroupsExtension_getXmlnsL3V1V1();
142  }
143
144  
145/**
146   * Constructor
147   */ public
148 GroupsExtension() {
149    this(libsbmlJNI.new_GroupsExtension__SWIG_0(), true);
150  }
151
152  
153/**
154   * Copy constructor.
155   */ public
156 GroupsExtension(GroupsExtension arg0) {
157    this(libsbmlJNI.new_GroupsExtension__SWIG_1(GroupsExtension.getCPtr(arg0), arg0), true);
158  }
159
160  
161/**
162   * Creates and returns a deep copy of this GroupsExtension object.
163   <p>
164   * @return a (deep) copy of this {@link SBase} object
165   */ public
166 GroupsExtension cloneObject() {
167    long cPtr = libsbmlJNI.GroupsExtension_cloneObject(swigCPtr, this);
168    return (cPtr == 0) ? null : new GroupsExtension(cPtr, true);
169  }
170
171  
172/**
173   * Returns the name of this package ('groups')
174   <p>
175   * @pram the name of this package ('groups')
176   */ public
177 String getName() {
178    return libsbmlJNI.GroupsExtension_getName(swigCPtr, this);
179  }
180
181  
182/**
183   * Returns the URI (namespace) of the package corresponding to the combination of 
184   * the given sbml level, sbml version, and package version.
185   * Empty string will be returned if no corresponding URI exists.
186   <p>
187   * @param sbmlLevel the level of SBML
188   * @param sbmlVersion the version of SBML
189   * @param pkgVersion the version of package
190   <p>
191   * @return a string of the package URI
192   */ public
193 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) {
194    return libsbmlJNI.GroupsExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion);
195  }
196
197  
198/**
199   * Returns the SBML level with the given URI of this package.
200   <p>
201   * @param uri the string of URI that represents one of versions of groups package
202   <p>
203   * @return the SBML level with the given URI of this package. 0 will be returned
204   * if the given URI is invalid.
205   */ public
206 long getLevel(String uri) {
207    return libsbmlJNI.GroupsExtension_getLevel(swigCPtr, this, uri);
208  }
209
210  
211/**
212   * Returns the SBML version with the given URI of this package.
213   <p>
214   * @param uri the string of URI that represents one of versions of groups package
215   <p>
216   * @return the SBML version with the given URI of this package. 0 will be returned
217   * if the given URI is invalid.
218   */ public
219 long getVersion(String uri) {
220    return libsbmlJNI.GroupsExtension_getVersion(swigCPtr, this, uri);
221  }
222
223  
224/**
225   * Returns the package version with the given URI of this package.
226   <p>
227   * @param uri the string of URI that represents one of versions of groups package
228   <p>
229   * @return the package version with the given URI of this package. 0 will be returned
230   * if the given URI is invalid.
231   */ public
232 long getPackageVersion(String uri) {
233    return libsbmlJNI.GroupsExtension_getPackageVersion(swigCPtr, this, uri);
234  }
235
236  
237/**
238   * Returns an {@link SBMLExtensionNamespaces}<GroupsExtension> object whose alias type is 
239   * GroupsPkgNamespace.
240   * Null will be returned if the given uri is not defined in the groups package.
241   <p>
242   * @param uri the string of URI that represents one of versions of groups package
243   <p>
244   * @return an GroupsPkgNamespace object corresponding to the given uri. null will
245   * be returned if the given URI is not defined in groups package.
246   */ public
247 SBMLNamespaces getSBMLExtensionNamespaces(String uri) {
248  return libsbml.DowncastSBMLNamespaces(libsbmlJNI.GroupsExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false);
249}
250
251  
252/**
253   * This method takes a type code from the Groups package and returns a string representing 
254   * the code.
255   */ public
256 String getStringFromTypeCode(int typeCode) {
257    return libsbmlJNI.GroupsExtension_getStringFromTypeCode(swigCPtr, this, typeCode);
258  }
259
260  
261/** * @internal */ public
262 static void init() {
263    libsbmlJNI.GroupsExtension_init();
264  }
265
266  
267/** * @internal */ public
268 SWIGTYPE_p_packageErrorTableEntry getErrorTable(long index) {
269    return new SWIGTYPE_p_packageErrorTableEntry(libsbmlJNI.GroupsExtension_getErrorTable(swigCPtr, this, index), true);
270  }
271
272  
273/** * @internal */ public
274 long getErrorTableIndex(long errorId) {
275    return libsbmlJNI.GroupsExtension_getErrorTableIndex(swigCPtr, this, errorId);
276  }
277
278  
279/** * @internal */ public
280 long getErrorIdOffset() {
281    return libsbmlJNI.GroupsExtension_getErrorIdOffset(swigCPtr, this);
282  }
283
284}