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-fbc"><a href="group__fbc.html">fbc</a></span> 013 A list of {@link FluxBound} objects. 014 <p> 015 * The {@link ListOfFluxBounds} is a container for the {@link FluxBound} elements of a {@link Model}. 016 * It is only defined for Version 1 of the “fbc” 017 * specification, and was replaced in Version 2 by {@link Parameter} elements 018 * referenced by the 'upperFluxBound' or 'lowerFluxBound' attributes on an 019 * {@link FbcReactionPlugin}. {@link FluxBound} and {@link ListOfFluxBounds} are not used for 020 * Version 2 “fbc” models. 021 <p> 022 * <p> 023 * The various ListOf___ classes in SBML 024 * are merely containers used for organizing the main components of an SBML 025 * model. In libSBML's implementation, ListOf___ 026 * classes are derived from the 027 * intermediate utility class {@link ListOf}, which 028 * is not defined by the SBML specifications but serves as a useful 029 * programmatic construct. {@link ListOf} is itself is in turn derived from {@link SBase}, 030 * which provides all of the various ListOf___ 031 * classes with common features 032 * defined by the SBML specification, such as 'metaid' attributes and 033 * annotations. 034 <p> 035 * Readers may wonder about the motivations for using the ListOf___ 036 * containers in SBML. A simpler approach in XML might be to place the 037 * components all directly at the top level of the model definition. The 038 * choice made in SBML is to group them within XML elements named after 039 * ListOf<em>Classname</em>, in part because it helps organize the 040 * components. More importantly, the fact that the container classes are 041 * derived from {@link SBase} means that software tools can add information <em>about</em> 042 * the lists themselves into each list container's 'annotation'. 043 <p> 044 * @see ListOfFunctionDefinitions 045 * @see ListOfUnitDefinitions 046 * @see ListOfCompartmentTypes 047 * @see ListOfSpeciesTypes 048 * @see ListOfCompartments 049 * @see ListOfSpecies 050 * @see ListOfParameters 051 * @see ListOfInitialAssignments 052 * @see ListOfRules 053 * @see ListOfConstraints 054 * @see ListOfReactions 055 * @see ListOfEvents 056 <p> 057 * 058 * @note This class and {@link FluxBound} are only defined for Version 1 of the 059 * “fbc” package specification. These classes are not used in 060 * Version 2 of “fbc”. 061 <p> 062 * @see FluxBound 063 */ 064 065public class ListOfFluxBounds extends ListOf { 066 private long swigCPtr; 067 068 protected ListOfFluxBounds(long cPtr, boolean cMemoryOwn) 069 { 070 super(libsbmlJNI.ListOfFluxBounds_SWIGUpcast(cPtr), cMemoryOwn); 071 swigCPtr = cPtr; 072 } 073 074 protected static long getCPtr(ListOfFluxBounds obj) 075 { 076 return (obj == null) ? 0 : obj.swigCPtr; 077 } 078 079 protected static long getCPtrAndDisown (ListOfFluxBounds obj) 080 { 081 long ptr = 0; 082 083 if (obj != null) 084 { 085 ptr = obj.swigCPtr; 086 obj.swigCMemOwn = false; 087 } 088 089 return ptr; 090 } 091 092 protected void finalize() { 093 delete(); 094 } 095 096 public synchronized void delete() { 097 if (swigCPtr != 0) { 098 if (swigCMemOwn) { 099 swigCMemOwn = false; 100 libsbmlJNI.delete_ListOfFluxBounds(swigCPtr); 101 } 102 swigCPtr = 0; 103 } 104 super.delete(); 105 } 106 107 108/** 109 * Creates and returns a deep copy of this {@link ListOfFluxBounds}. 110 <p> 111 * @return a (deep) copy of this {@link ListOfFluxBounds}. 112 */ public 113 ListOfFluxBounds cloneObject() { 114 long cPtr = libsbmlJNI.ListOfFluxBounds_cloneObject(swigCPtr, this); 115 return (cPtr == 0) ? null : new ListOfFluxBounds(cPtr, true); 116 } 117 118 119/** 120 * Creates a new {@link ListOfFluxBounds} with the given level, version, and package version. 121 */ public 122 ListOfFluxBounds(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 123 this(libsbmlJNI.new_ListOfFluxBounds__SWIG_0(level, version, pkgVersion), true); 124 } 125 126 127/** 128 * Creates a new {@link ListOfFluxBounds} with the given level, version, and package version. 129 */ public 130 ListOfFluxBounds(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 131 this(libsbmlJNI.new_ListOfFluxBounds__SWIG_1(level, version), true); 132 } 133 134 135/** 136 * Creates a new {@link ListOfFluxBounds} with the given level, version, and package version. 137 */ public 138 ListOfFluxBounds(long level) throws org.sbml.libsbml.SBMLConstructorException { 139 this(libsbmlJNI.new_ListOfFluxBounds__SWIG_2(level), true); 140 } 141 142 143/** 144 * Creates a new {@link ListOfFluxBounds} with the given level, version, and package version. 145 */ public 146 ListOfFluxBounds() throws org.sbml.libsbml.SBMLConstructorException { 147 this(libsbmlJNI.new_ListOfFluxBounds__SWIG_3(), true); 148 } 149 150 151/** 152 * Creates a new {@link ListOfFluxBounds} with the given {@link FbcPkgNamespaces} object. 153 */ public 154 ListOfFluxBounds(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 155 this(libsbmlJNI.new_ListOfFluxBounds__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 156 } 157 158 159/** 160 * Get a {@link FluxBound} from the {@link ListOfFluxBounds}. 161 <p> 162 * @param n the index number of the {@link FluxBound} to get. 163 <p> 164 * @return the nth {@link FluxBound} in this {@link ListOfFluxBounds}. 165 <p> 166 * @see #size() 167 */ public 168 FluxBound get(long n) { 169 long cPtr = libsbmlJNI.ListOfFluxBounds_get__SWIG_0(swigCPtr, this, n); 170 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 171 } 172 173 174/** 175 * Get a {@link FluxBound} from the {@link ListOfFluxBounds} 176 * based on its identifier. 177 <p> 178 * @param sid a string representing the identifier 179 * of the {@link FluxBound} to get. 180 <p> 181 * @return {@link FluxBound} in this {@link ListOfFluxBounds} 182 * with the given <code>sid</code> or <code>null</code> if no such 183 * {@link FluxBound} exists. 184 <p> 185 * @see #get(long n) 186 * @see #size() 187 */ public 188 FluxBound get(String sid) { 189 long cPtr = libsbmlJNI.ListOfFluxBounds_get__SWIG_2(swigCPtr, this, sid); 190 return (cPtr == 0) ? null : new FluxBound(cPtr, false); 191 } 192 193 194/** 195 * Removes the nth item from this {@link ListOfFluxBounds} items and returns a pointer to 196 * it. 197 <p> 198 * The caller owns the returned item and is responsible for deleting it. 199 <p> 200 * @param n the index of the item to remove 201 <p> 202 * @see #size() 203 */ public 204 FluxBound remove(long n) { 205 long cPtr = libsbmlJNI.ListOfFluxBounds_remove__SWIG_0(swigCPtr, this, n); 206 return (cPtr == 0) ? null : new FluxBound(cPtr, true); 207 } 208 209 210/** 211 * Removes item in this {@link ListOfFluxBounds} 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 FluxBound remove(String sid) { 223 long cPtr = libsbmlJNI.ListOfFluxBounds_remove__SWIG_1(swigCPtr, this, sid); 224 return (cPtr == 0) ? null : new FluxBound(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_FLUXBOUND SBML_FBC_FLUXBOUND} (default). 245 <p> 246 * @see #getElementName() 247 * @see #getPackageName() 248 */ public 249 int getItemTypeCode() { 250 return libsbmlJNI.ListOfFluxBounds_getItemTypeCode(swigCPtr, this); 251 } 252 253 254/** 255 * Returns the XML element name of this object. 256 <p> 257 * For {@link ListOfFluxBounds}, the XML element name is always <code>'listOfFluxBounds'.</code> 258 <p> 259 * @return the name of this element, i.e. <code>'listOfFluxBounds'.</code> 260 */ public 261 String getElementName() { 262 return libsbmlJNI.ListOfFluxBounds_getElementName(swigCPtr, this); 263 } 264 265}