001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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-fbc"><a href="group__fbc.html">fbc</a></span> 013 A list of {@link GeneAssociation} objects. 014 <p> 015 * The {@link ListOfGeneAssociations} is a container for the {@link GeneAssociation} elements of the proposed {@link Model} annotation, and is not part of the official FBC specification. 016 <p> 017 * <p> 018 * The various ListOf___ classes in SBML 019 * are merely containers used for organizing the main components of an SBML 020 * model. In libSBML's implementation, ListOf___ 021 * classes are derived from the 022 * intermediate utility class {@link ListOf}, which 023 * is not defined by the SBML specifications but serves as a useful 024 * programmatic construct. {@link ListOf} is itself is in turn derived from {@link SBase}, 025 * which provides all of the various ListOf___ 026 * classes with common features 027 * defined by the SBML specification, such as 'metaid' attributes and 028 * annotations. 029 <p> 030 * The relationship between the lists and the rest of an SBML model is 031 * illustrated by the following (for SBML Level 2 Version 4): 032 <p> 033 * <figure> 034 <object type="image/svg+xml" data="listof-illustration.svg" class="centered"></object> 035</figure> 036 037 <p> 038 * Readers may wonder about the motivations for using the ListOf___ 039 * containers in SBML. A simpler approach in XML might be to place the 040 * components all directly at the top level of the model definition. The 041 * choice made in SBML is to group them within XML elements named after 042 * ListOf<em>Classname</em>, in part because it helps organize the 043 * components. More importantly, the fact that the container classes are 044 * derived from {@link SBase} means that software tools can add information <em>about</em> 045 * the lists themselves into each list container's 'annotation'. 046 <p> 047 * @see ListOfFunctionDefinitions 048 * @see ListOfUnitDefinitions 049 * @see ListOfCompartmentTypes 050 * @see ListOfSpeciesTypes 051 * @see ListOfCompartments 052 * @see ListOfSpecies 053 * @see ListOfParameters 054 * @see ListOfInitialAssignments 055 * @see ListOfRules 056 * @see ListOfConstraints 057 * @see ListOfReactions 058 * @see ListOfEvents 059 <p> 060 * @see GeneAssociation 061 */ 062 063public class ListOfGeneAssociations extends ListOf { 064 private long swigCPtr; 065 066 protected ListOfGeneAssociations(long cPtr, boolean cMemoryOwn) 067 { 068 super(libsbmlJNI.ListOfGeneAssociations_SWIGUpcast(cPtr), cMemoryOwn); 069 swigCPtr = cPtr; 070 } 071 072 protected static long getCPtr(ListOfGeneAssociations obj) 073 { 074 return (obj == null) ? 0 : obj.swigCPtr; 075 } 076 077 protected static long getCPtrAndDisown (ListOfGeneAssociations obj) 078 { 079 long ptr = 0; 080 081 if (obj != null) 082 { 083 ptr = obj.swigCPtr; 084 obj.swigCMemOwn = false; 085 } 086 087 return ptr; 088 } 089 090 protected void finalize() { 091 delete(); 092 } 093 094 public synchronized void delete() { 095 if (swigCPtr != 0) { 096 if (swigCMemOwn) { 097 swigCMemOwn = false; 098 libsbmlJNI.delete_ListOfGeneAssociations(swigCPtr); 099 } 100 swigCPtr = 0; 101 } 102 super.delete(); 103 } 104 105 106/** 107 * Creates and returns a deep copy of this {@link ListOfGeneAssociations}. 108 <p> 109 * @return a (deep) copy of this {@link ListOfGeneAssociations}. 110 */ public 111 ListOfGeneAssociations cloneObject() { 112 long cPtr = libsbmlJNI.ListOfGeneAssociations_cloneObject(swigCPtr, this); 113 return (cPtr == 0) ? null : new ListOfGeneAssociations(cPtr, true); 114 } 115 116 117/** 118 * Creates a new {@link ListOfGeneAssociations} with the given level, version, and package version. 119 */ public 120 ListOfGeneAssociations(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 121 this(libsbmlJNI.new_ListOfGeneAssociations__SWIG_0(level, version, pkgVersion), true); 122 } 123 124 125/** 126 * Creates a new {@link ListOfGeneAssociations} with the given level, version, and package version. 127 */ public 128 ListOfGeneAssociations(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 129 this(libsbmlJNI.new_ListOfGeneAssociations__SWIG_1(level, version), true); 130 } 131 132 133/** 134 * Creates a new {@link ListOfGeneAssociations} with the given level, version, and package version. 135 */ public 136 ListOfGeneAssociations(long level) throws org.sbml.libsbml.SBMLConstructorException { 137 this(libsbmlJNI.new_ListOfGeneAssociations__SWIG_2(level), true); 138 } 139 140 141/** 142 * Creates a new {@link ListOfGeneAssociations} with the given level, version, and package version. 143 */ public 144 ListOfGeneAssociations() throws org.sbml.libsbml.SBMLConstructorException { 145 this(libsbmlJNI.new_ListOfGeneAssociations__SWIG_3(), true); 146 } 147 148 149/** 150 * Creates a new {@link ListOfGeneAssociations} with the given {@link FbcPkgNamespaces} object. 151 */ public 152 ListOfGeneAssociations(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 153 this(libsbmlJNI.new_ListOfGeneAssociations__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 154 } 155 156 157/** 158 * Get a {@link GeneAssociation} from the {@link ListOfGeneAssociations}. 159 <p> 160 * @param n the index number of the {@link GeneAssociation} to get. 161 <p> 162 * @return the nth {@link GeneAssociation} in this {@link ListOfGeneAssociations}. 163 <p> 164 * @see #size() 165 */ public 166 GeneAssociation get(long n) { 167 long cPtr = libsbmlJNI.ListOfGeneAssociations_get__SWIG_0(swigCPtr, this, n); 168 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 169 } 170 171 172/** 173 * Get a {@link GeneAssociation} from the {@link ListOfGeneAssociations} 174 * based on its identifier. 175 <p> 176 * @param sid a string representing the identifier 177 * of the {@link GeneAssociation} to get. 178 <p> 179 * @return {@link GeneAssociation} in this {@link ListOfGeneAssociations} 180 * with the given <code>sid</code> or <code>null</code> if no such 181 * {@link GeneAssociation} exists. 182 <p> 183 * @see #get(long n) 184 * @see #size() 185 */ public 186 GeneAssociation get(String sid) { 187 long cPtr = libsbmlJNI.ListOfGeneAssociations_get__SWIG_2(swigCPtr, this, sid); 188 return (cPtr == 0) ? null : new GeneAssociation(cPtr, false); 189 } 190 191 192/** 193 * Removes the nth item from this {@link ListOfGeneAssociations} items and returns a pointer to 194 * it. 195 <p> 196 * The caller owns the returned item and is responsible for deleting it. 197 <p> 198 * @param n the index of the item to remove 199 * @return the item removed. As mentioned above, the caller owns the 200 * returned item. 201 <p> 202 * @see #size() 203 */ public 204 GeneAssociation remove(long n) { 205 long cPtr = libsbmlJNI.ListOfGeneAssociations_remove__SWIG_0(swigCPtr, this, n); 206 return (cPtr == 0) ? null : new GeneAssociation(cPtr, true); 207 } 208 209 210/** 211 * Removes item in this {@link ListOfGeneAssociations} items with the given identifier. 212 <p> 213 * The caller owns the returned item and is responsible for deleting it. 214 * If none of the items in this list have the identifier <code>sid</code>, then @c 215 * null is returned. 216 <p> 217 * @param sid the identifier of the item to remove 218 <p> 219 * @return the item removed. As mentioned above, the caller owns the 220 * returned item. 221 */ public 222 GeneAssociation remove(String sid) { 223 long cPtr = libsbmlJNI.ListOfGeneAssociations_remove__SWIG_1(swigCPtr, this, sid); 224 return (cPtr == 0) ? null : new GeneAssociation(cPtr, true); 225 } 226 227 228/** 229 * Returns the libSBML type code for the SBML objects 230 * contained in this {@link ListOf} object. 231 <p> 232 * <p> 233 * LibSBML attaches an identifying code to every kind of SBML object. These 234 * are integer constants known as <em>SBML type codes</em>. The names of all 235 * the codes begin with the characters <code>SBML_</code>. 236 * In the Java language interface for libSBML, the 237 * type codes are defined as static integer constants in the interface class 238 * {@link libsbmlConstants}. Note that different Level 3 239 * package plug-ins may use overlapping type codes; to identify the package 240 * to which a given object belongs, call the <code>getPackageName()</code> 241 * method on the object. 242 <p> 243 * @return the SBML type code for objects contained in this list: 244 * {@link libsbmlConstants#SBML_FBC_GENEASSOCIATION SBML_FBC_GENEASSOCIATION} (default). 245 <p> 246 * @see #getElementName() 247 * @see #getPackageName() 248 */ public 249 int getItemTypeCode() { 250 return libsbmlJNI.ListOfGeneAssociations_getItemTypeCode(swigCPtr, this); 251 } 252 253 254/** 255 * Returns the XML element name of this object. 256 <p> 257 * For {@link ListOfGeneAssociations}, the XML element name is always <code>'listOfGeneAssociations'.</code> 258 <p> 259 * @return the name of this element, i.e. <code>'listOfGeneAssociations'.</code> 260 */ public 261 String getElementName() { 262 return libsbmlJNI.ListOfGeneAssociations_getElementName(swigCPtr, this); 263 } 264 265}