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 * Template class for the SBMLDocument Plugin class needed 013 * by all packages. 014 <p> 015 * Plugin objects for the {@link SBMLDocument} element must be this class or a 016 * derived class of this class. Package developers should use this class 017 * as-is if only 'required' attribute is added in the {@link SBMLDocument} element by 018 * their packages. Otherwise, developers must implement a derived class of 019 * this class and use that class as the plugin object for the {@link SBMLDocument} 020 * element. 021 */ 022 023public class SBMLDocumentPlugin extends SBasePlugin { 024 private long swigCPtr; 025 026 protected SBMLDocumentPlugin(long cPtr, boolean cMemoryOwn) 027 { 028 super(libsbmlJNI.SBMLDocumentPlugin_SWIGUpcast(cPtr), cMemoryOwn); 029 swigCPtr = cPtr; 030 } 031 032 protected static long getCPtr(SBMLDocumentPlugin obj) 033 { 034 return (obj == null) ? 0 : obj.swigCPtr; 035 } 036 037 protected static long getCPtrAndDisown (SBMLDocumentPlugin obj) 038 { 039 long ptr = 0; 040 041 if (obj != null) 042 { 043 ptr = obj.swigCPtr; 044 obj.swigCMemOwn = false; 045 } 046 047 return ptr; 048 } 049 050 protected void finalize() { 051 delete(); 052 } 053 054 public synchronized void delete() { 055 if (swigCPtr != 0) { 056 if (swigCMemOwn) { 057 swigCMemOwn = false; 058 libsbmlJNI.delete_SBMLDocumentPlugin(swigCPtr); 059 } 060 swigCPtr = 0; 061 } 062 super.delete(); 063 } 064 065 066/** 067 * Constructor 068 <p> 069 * @param uri the URI of package 070 * @param prefix the prefix for the given package 071 * @param sbmlns the {@link SBMLNamespaces} object for the package 072 */ public 073 SBMLDocumentPlugin(String uri, String prefix, SBMLNamespaces sbmlns) { 074 this(libsbmlJNI.new_SBMLDocumentPlugin__SWIG_0(uri, prefix, SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 075 } 076 077 078/** 079 * Copy constructor. Creates a copy of this object. 080 */ public 081 SBMLDocumentPlugin(SBMLDocumentPlugin orig) { 082 this(libsbmlJNI.new_SBMLDocumentPlugin__SWIG_1(SBMLDocumentPlugin.getCPtr(orig), orig), true); 083 } 084 085 086/** 087 * Creates and returns a deep copy of this {@link SBMLDocumentPlugin} object. 088 <p> 089 * @return a (deep) copy of this object 090 */ public 091 SBasePlugin cloneObject() { 092 long cPtr = libsbmlJNI.SBMLDocumentPlugin_cloneObject(swigCPtr, this); 093 return (cPtr == 0) ? null : new SBMLDocumentPlugin(cPtr, true); 094 } 095 096 097/** 098 <p> 099 * Sets the boolean value of 'required' attribute of corresponding package 100 * in {@link SBMLDocument} element. 101 <p> 102 * @param value the boolean value of 'required' attribute of corresponding 103 * package in {@link SBMLDocument} element. 104 <p> 105 * @return integer value indicating success/failure of the 106 * function. The possible values 107 * returned by this function are: 108 * <ul> 109 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 110 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE } 111 * </ul> 112 */ public 113 int setRequired(boolean value) { 114 return libsbmlJNI.SBMLDocumentPlugin_setRequired(swigCPtr, this, value); 115 } 116 117 118/** 119 <p> 120 * Returns the boolean value of 'required' attribute of corresponding 121 * package in {@link SBMLDocument} element. 122 <p> 123 * @return the boolean value of 'required' attribute of corresponding 124 * package in {@link SBMLDocument} element. 125 */ public 126 boolean getRequired() { 127 return libsbmlJNI.SBMLDocumentPlugin_getRequired(swigCPtr, this); 128 } 129 130 131/** 132 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 133 * {@link SBMLDocumentPlugin}'s 'required' attribute has been set. 134 <p> 135 * @return <code>true</code> if the 'required' attribute of this {@link SBMLDocument} has been 136 * set, <code>false</code> otherwise. 137 */ public 138 boolean isSetRequired() { 139 return libsbmlJNI.SBMLDocumentPlugin_isSetRequired(swigCPtr, this); 140 } 141 142 143/** 144 * Unsets the value of the 'required' attribute of this {@link SBMLDocumentPlugin}. 145 <p> 146 * @return integer value indicating success/failure of the 147 * function. The possible values 148 * returned by this function are: 149 * <ul> 150 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 151 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 152 * </ul> 153 */ public 154 int unsetRequired() { 155 return libsbmlJNI.SBMLDocumentPlugin_unsetRequired(swigCPtr, this); 156 } 157 158 159/** * @internal */ public 160 boolean isCompFlatteningImplemented() { 161 return libsbmlJNI.SBMLDocumentPlugin_isCompFlatteningImplemented(swigCPtr, this); 162 } 163 164 165/** 166 * Check consistency function. 167 * @internal 168 */ public 169 long checkConsistency() { 170 return libsbmlJNI.SBMLDocumentPlugin_checkConsistency(swigCPtr, this); 171 } 172 173}