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