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 Base class for {@link FbcAnd}, {@link FbcOr}, and {@link GeneProductRef} 014 <p> 015 * The {@link FbcAssociation} class is the abstract base class for the classes that 016 * can be used as children of the {@link GeneProductAssociation} child of a {@link Reaction}. 017 * The {@link FbcAnd} class is used when all of its children are definitely associated 018 * with the {@link Reaction}; the {@link FbcOr} class is used when at least one of its children 019 * are associated with the {@link Reaction}; and the {@link GeneProductRef} class is used to 020 * denote a particular {@link GeneProduct}. 021 <p> 022 * <p> 023 * @note This class of objects was introduced in Version 2 of the 024 * SBML Level 3 Flux Balance Constraints (“fbc”) 025 * specification. In Version 1 of “fbc”, the information 026 * encoded by this class can be stored instead using the {@link Association} and 027 * {@link GeneAssociation} annotation classes. Please see the Version 1 and 028 * Version 2 “fbc” specifications for more details. 029 <p> 030 * @see ListOfFbcAssociations 031 * @see FbcAnd 032 * @see FbcOr 033 * @see GeneProductRef 034 */ 035 036public class FbcAssociation extends SBase { 037 private long swigCPtr; 038 039 protected FbcAssociation(long cPtr, boolean cMemoryOwn) 040 { 041 super(libsbmlJNI.FbcAssociation_SWIGUpcast(cPtr), cMemoryOwn); 042 swigCPtr = cPtr; 043 } 044 045 protected static long getCPtr(FbcAssociation obj) 046 { 047 return (obj == null) ? 0 : obj.swigCPtr; 048 } 049 050 protected static long getCPtrAndDisown (FbcAssociation obj) 051 { 052 long ptr = 0; 053 054 if (obj != null) 055 { 056 ptr = obj.swigCPtr; 057 obj.swigCMemOwn = false; 058 } 059 060 return ptr; 061 } 062 063 protected void finalize() { 064 delete(); 065 } 066 067 public synchronized void delete() { 068 if (swigCPtr != 0) { 069 if (swigCMemOwn) { 070 swigCMemOwn = false; 071 libsbmlJNI.delete_FbcAssociation(swigCPtr); 072 } 073 swigCPtr = 0; 074 } 075 super.delete(); 076 } 077 078 079/** 080 * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and 081 * “fbc”package version. 082 <p> 083 * @param level a long integer, the SBML Level to assign to this 084 * {@link FbcAssociation} 085 <p> 086 * @param version a long integer, the SBML Version to assign to this 087 * {@link FbcAssociation} 088 <p> 089 * @param pkgVersion a long integer, the SBML “fbc” package 090 * Version to assign to this {@link FbcAssociation} 091 */ public 092 FbcAssociation(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 093 this(libsbmlJNI.new_FbcAssociation__SWIG_0(level, version, pkgVersion), true); 094 } 095 096 097/** 098 * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and 099 * “fbc”package version. 100 <p> 101 * @param level a long integer, the SBML Level to assign to this 102 * {@link FbcAssociation} 103 <p> 104 * @param version a long integer, the SBML Version to assign to this 105 * {@link FbcAssociation} 106 <p> 107 * @param pkgVersion a long integer, the SBML “fbc” package 108 * Version to assign to this {@link FbcAssociation} 109 */ public 110 FbcAssociation(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 111 this(libsbmlJNI.new_FbcAssociation__SWIG_1(level, version), true); 112 } 113 114 115/** 116 * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and 117 * “fbc”package version. 118 <p> 119 * @param level a long integer, the SBML Level to assign to this 120 * {@link FbcAssociation} 121 <p> 122 * @param version a long integer, the SBML Version to assign to this 123 * {@link FbcAssociation} 124 <p> 125 * @param pkgVersion a long integer, the SBML “fbc” package 126 * Version to assign to this {@link FbcAssociation} 127 */ public 128 FbcAssociation(long level) throws org.sbml.libsbml.SBMLConstructorException { 129 this(libsbmlJNI.new_FbcAssociation__SWIG_2(level), true); 130 } 131 132 133/** 134 * Creates a new {@link FbcAssociation} with the given SBML Level, Version, and 135 * “fbc”package version. 136 <p> 137 * @param level a long integer, the SBML Level to assign to this 138 * {@link FbcAssociation} 139 <p> 140 * @param version a long integer, the SBML Version to assign to this 141 * {@link FbcAssociation} 142 <p> 143 * @param pkgVersion a long integer, the SBML “fbc” package 144 * Version to assign to this {@link FbcAssociation} 145 */ public 146 FbcAssociation() throws org.sbml.libsbml.SBMLConstructorException { 147 this(libsbmlJNI.new_FbcAssociation__SWIG_3(), true); 148 } 149 150 151/** 152 * Creates a new {@link FbcAssociation} with the given {@link FbcPkgNamespaces} object. 153 <p> 154 * @param fbcns the {@link FbcPkgNamespaces} object 155 */ public 156 FbcAssociation(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException { 157 this(libsbmlJNI.new_FbcAssociation__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 158 } 159 160 161/** 162 * Copy constructor for {@link FbcAssociation}. 163 <p> 164 * @param orig; the {@link FbcAssociation} instance to copy. 165 */ public 166 FbcAssociation(FbcAssociation orig) throws org.sbml.libsbml.SBMLConstructorException { 167 this(libsbmlJNI.new_FbcAssociation__SWIG_5(FbcAssociation.getCPtr(orig), orig), true); 168 } 169 170 171/** 172 * Creates and returns a deep copy of this {@link FbcAssociation} object. 173 <p> 174 * @return a (deep) copy of this {@link FbcAssociation} object. 175 */ public 176 FbcAssociation cloneObject() { 177 return (FbcAssociation) libsbml.DowncastSBase(libsbmlJNI.FbcAssociation_cloneObject(swigCPtr, this), true); 178} 179 180 181/** 182 * Returns <code>true</code>, if this abstract 'FbcAssociation' is of type {@link FbcAnd}. 183 <p> 184 * @return <code>true</code>, if this abstract 'FbcAssociation' is of type {@link FbcAnd}. 185 */ public 186 boolean isFbcAnd() { 187 return libsbmlJNI.FbcAssociation_isFbcAnd(swigCPtr, this); 188 } 189 190 191/** 192 * Returns <code>true</code>, if this abstract 'FbcAssociation' is of type {@link FbcOr}. 193 <p> 194 * @return <code>true</code>, if this abstract 'FbcAssociation' is of type {@link FbcOr}. 195 */ public 196 boolean isFbcOr() { 197 return libsbmlJNI.FbcAssociation_isFbcOr(swigCPtr, this); 198 } 199 200 201/** 202 * Returns <code>true</code>, if this abstract 'FbcAssociation' is of type 203 * {@link GeneProductRef}. 204 <p> 205 * @return <code>true</code>, if this abstract 'FbcAssociation' is of type 206 * {@link GeneProductRef}. 207 */ public 208 boolean isGeneProductRef() { 209 return libsbmlJNI.FbcAssociation_isGeneProductRef(swigCPtr, this); 210 } 211 212 213/** 214 * Returns the XML element name of this object. 215 <p> 216 * For {@link FbcAssociation}, the XML element name is always <code>'fbcAssociation'.</code> 217 <p> 218 * @return the name of this element, i.e. <code>'fbcAssociation'.</code> 219 */ public 220 String getElementName() { 221 return libsbmlJNI.FbcAssociation_getElementName(swigCPtr, this); 222 } 223 224 225/** 226 * Returns the libSBML type code for this SBML object. 227 <p> 228 * <p> 229 * LibSBML attaches an identifying code to every kind of SBML object. These 230 * are integer constants known as <em>SBML type codes</em>. The names of all 231 * the codes begin with the characters <code>SBML_</code>. 232 * In the Java language interface for libSBML, the 233 * type codes are defined as static integer constants in the interface class 234 * {@link libsbmlConstants}. Note that different Level 3 235 * package plug-ins may use overlapping type codes; to identify the package 236 * to which a given object belongs, call the <code>getPackageName()</code> 237 * method on the object. 238 <p> 239 * @return the SBML type code for this object: 240 * {@link libsbmlConstants#SBML_FBC_ASSOCIATION SBML_FBC_ASSOCIATION} (default). 241 <p> 242 * <p> 243 * @warning <span class='warning'>The specific integer values of the possible 244 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 245 * packages, To fully identify the correct code, <strong>it is necessary to 246 * invoke both getTypeCode() and getPackageName()</strong>.</span> 247 <p> 248 * @see #getElementName() 249 * @see #getPackageName() 250 */ public 251 int getTypeCode() { 252 return libsbmlJNI.FbcAssociation_getTypeCode(swigCPtr, this); 253 } 254 255 256/** 257 * Predicate returning <code>true</code> if all the required attributes 258 * for this {@link FbcAssociation} object have been set. 259 <p> 260 * @note {@link FbcAssociation} has no required attributes, so this 261 * method always returns <code>true.</code> 262 <p> 263 * @return a boolean value indicating whether all the required 264 * attributes for this object have been defined. 265 */ public 266 boolean hasRequiredAttributes() { 267 return libsbmlJNI.FbcAssociation_hasRequiredAttributes(swigCPtr, this); 268 } 269 270 271/** 272 * Parses a gene association in infix format and returns a corresponding 273 * {@link Association} object. 274 <p> 275 * This parses a string that has a list of gene names and conjunctions 276 * or disjunctions. For example: 277 * <pre class='fragment'> 278 (b2422) and (b2425) and (b2423) and (b2424) or (b2422) and (b2423) and (b2424) and (b2413) and (b3917) 279</pre> 280 <p> 281 * This method also creates missing {@link GeneProduct} objects, in case the unique 282 * reference does not yet exist. 283 <p> 284 * @param association the string to parse. 285 * @param plugin the {@link FbcModelPlugin} on which to add the geneProduct elements 286 <p> 287 * @return the parsed association, or <code>null</code> in case of an error. 288 <p> 289 * 290 */ public 291 static FbcAssociation parseFbcInfixAssociation(String association, FbcModelPlugin plugin) { 292 return (FbcAssociation) libsbml.DowncastSBase(libsbmlJNI.FbcAssociation_parseFbcInfixAssociation(association, FbcModelPlugin.getCPtr(plugin), plugin), false); 293} 294 295 296/** 297 * Converts this {@link FbcAssociation} object into an infix string representation. 298 <p> 299 * @return the association as infix string. 300 */ public 301 String toInfix() { 302 return libsbmlJNI.FbcAssociation_toInfix(swigCPtr, this); 303 } 304 305 306/** * @internal */ public 307 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 308 libsbmlJNI.FbcAssociation_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 309 } 310 311 312/** */ public 313 void setElementName(String name) { 314 libsbmlJNI.FbcAssociation_setElementName(swigCPtr, this, name); 315 } 316 317}