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