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 * container class that stores {@link LocalRenderInformation} objects. 013 <p> 014 * Layouts can contain {@link ListOfLocalRenderInformation} which holds all 015 * {@link LocalRenderInformation} objects for a certain layout. 016 */ 017 018public class ListOfLocalRenderInformation extends ListOf { 019 private long swigCPtr; 020 021 protected ListOfLocalRenderInformation(long cPtr, boolean cMemoryOwn) 022 { 023 super(libsbmlJNI.ListOfLocalRenderInformation_SWIGUpcast(cPtr), cMemoryOwn); 024 swigCPtr = cPtr; 025 } 026 027 protected static long getCPtr(ListOfLocalRenderInformation obj) 028 { 029 return (obj == null) ? 0 : obj.swigCPtr; 030 } 031 032 protected static long getCPtrAndDisown (ListOfLocalRenderInformation obj) 033 { 034 long ptr = 0; 035 036 if (obj != null) 037 { 038 ptr = obj.swigCPtr; 039 obj.swigCMemOwn = false; 040 } 041 042 return ptr; 043 } 044 045 protected void finalize() { 046 delete(); 047 } 048 049 public synchronized void delete() { 050 if (swigCPtr != 0) { 051 if (swigCMemOwn) { 052 swigCMemOwn = false; 053 libsbmlJNI.delete_ListOfLocalRenderInformation(swigCPtr); 054 } 055 swigCPtr = 0; 056 } 057 super.delete(); 058 } 059 060 061/** 062 * Creates and returns a deep copy of the {@link ListOfLocalRenderInformation} object. 063 <p> 064 * @return a (deep) copy of this {@link ListOfLocalRenderInformation} 065 */ public 066 ListOfLocalRenderInformation cloneObject() { 067 long cPtr = libsbmlJNI.ListOfLocalRenderInformation_cloneObject(swigCPtr, this); 068 return (cPtr == 0) ? null : new ListOfLocalRenderInformation(cPtr, true); 069 } 070 071 072/** 073 * Constructor which instantiates an empty {@link ListOfLocalRenderInformation} object. 074 */ public 075 ListOfLocalRenderInformation(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 076 this(libsbmlJNI.new_ListOfLocalRenderInformation__SWIG_0(level, version, pkgVersion), true); 077 } 078 079 080/** 081 * Constructor which instantiates an empty {@link ListOfLocalRenderInformation} object. 082 */ public 083 ListOfLocalRenderInformation(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 084 this(libsbmlJNI.new_ListOfLocalRenderInformation__SWIG_1(level, version), true); 085 } 086 087 088/** 089 * Constructor which instantiates an empty {@link ListOfLocalRenderInformation} object. 090 */ public 091 ListOfLocalRenderInformation(long level) throws org.sbml.libsbml.SBMLConstructorException { 092 this(libsbmlJNI.new_ListOfLocalRenderInformation__SWIG_2(level), true); 093 } 094 095 096/** 097 * Constructor which instantiates an empty {@link ListOfLocalRenderInformation} object. 098 */ public 099 ListOfLocalRenderInformation() throws org.sbml.libsbml.SBMLConstructorException { 100 this(libsbmlJNI.new_ListOfLocalRenderInformation__SWIG_3(), true); 101 } 102 103 104/** 105 * Ctor. 106 */ public 107 ListOfLocalRenderInformation(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 108 this(libsbmlJNI.new_ListOfLocalRenderInformation__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 109 } 110 111 112/** 113 * Copy constructor for {@link ListOfLocalRenderInformation} objects. 114 */ public 115 ListOfLocalRenderInformation(ListOfLocalRenderInformation source) throws org.sbml.libsbml.SBMLConstructorException { 116 this(libsbmlJNI.new_ListOfLocalRenderInformation__SWIG_5(ListOfLocalRenderInformation.getCPtr(source), source), true); 117 } 118 119 120/** 121 * Returns the XML element name of this object, which for 122 * {@link ListOfLocalRenderInformation}, is always <code>'listOfRenderInformation'.</code> 123 <p> 124 * @return the name of this element, i.e., <code>'listOfRenderInformation'.</code> 125 */ public 126 String getElementName() { 127 return libsbmlJNI.ListOfLocalRenderInformation_getElementName(swigCPtr, this); 128 } 129 130 131/** 132 * Creates an {@link XMLNode} object from this {@link ListOfGradientDefinitions} object. 133 <p> 134 * @return the {@link XMLNode} with the XML representation for the 135 * {@link ListOfGradientDefinitions} object. 136 */ public 137 XMLNode toXML() { 138 return new XMLNode(libsbmlJNI.ListOfLocalRenderInformation_toXML(swigCPtr, this), true); 139 } 140 141 142/** 143 * Sets the version of the render information list. 144 * The version consists of a major and a minor version number. 145 <p> 146 * @param major major version number 147 * @param minor minor version number 148 */ public 149 void setVersion(long major, long minor) { 150 libsbmlJNI.ListOfLocalRenderInformation_setVersion(swigCPtr, this, major, minor); 151 } 152 153 154/** 155 * Returns the major version of the render information list. 156 <p> 157 * @return the major version number of the local render information list 158 */ public 159 long getMajorVersion() { 160 return libsbmlJNI.ListOfLocalRenderInformation_getMajorVersion(swigCPtr, this); 161 } 162 163 164/** 165 * Returns the minor version of the render information list. 166 <p> 167 * @return the minor version number of the local render information list 168 */ public 169 long getMinorVersion() { 170 return libsbmlJNI.ListOfLocalRenderInformation_getMinorVersion(swigCPtr, this); 171 } 172 173 174/** 175 * Returns the version as a string. 176 <p> 177 * @return the version of the {@link LocalRenderInformation} object 178 * as a string 179 */ public 180 String getVersionString() { 181 return libsbmlJNI.ListOfLocalRenderInformation_getVersionString(swigCPtr, this); 182 } 183 184 185/** 186 * Returns a pointer to the {@link LocalRenderInformation} with the given index or null if 187 * the index is invalid. 188 <p> 189 * @param i index of the {@link LocalRenderInformation} object to be returned 190 <p> 191 * @return pointer to the {@link LocalRenderInformation} at the given index or null. 192 */ public 193 SBase get(long i) { 194 long cPtr = libsbmlJNI.ListOfLocalRenderInformation_get__SWIG_0(swigCPtr, this, i); 195 return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false); 196 } 197 198 199/** 200 * Returns a pointer to the {@link LocalRenderInformation} with the given <code>id</code> or <code>null</code> if 201 * the id is invalid. 202 <p> 203 * @param id id of the {@link LocalRenderInformation} object to be returned 204 <p> 205 * @return pointer to the {@link LocalRenderInformation} at the given <code>id</code> or <code>null.</code> 206 */ public 207 LocalRenderInformation get(String id) { 208 long cPtr = libsbmlJNI.ListOfLocalRenderInformation_get__SWIG_2(swigCPtr, this, id); 209 return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, false); 210 } 211 212 213/** 214 * Removes the nth item from this {@link ListOfLocalRenderInformation} items and returns a pointer to 215 * it. 216 <p> 217 * The caller owns the returned item and is responsible for deleting it. 218 <p> 219 * @param n the index of the item to remove 220 <p> 221 * @see #size() 222 */ public 223 SBase remove(long n) { 224 long cPtr = libsbmlJNI.ListOfLocalRenderInformation_remove__SWIG_0(swigCPtr, this, n); 225 return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, true); 226 } 227 228 229/** 230 * Removes item in this {@link ListOfLocalRenderInformation} items with the given identifier. 231 <p> 232 * The caller owns the returned item and is responsible for deleting it. 233 * If none of the items in this list have the identifier <code>sid</code>, then @c 234 * null is returned. 235 <p> 236 * @param sid the identifier of the item to remove 237 <p> 238 * @return the item removed. As mentioned above, the caller owns the 239 * returned item. 240 */ public 241 LocalRenderInformation remove(String sid) { 242 long cPtr = libsbmlJNI.ListOfLocalRenderInformation_remove__SWIG_1(swigCPtr, this, sid); 243 return (cPtr == 0) ? null : new LocalRenderInformation(cPtr, true); 244 } 245 246 247/** 248 * Get the type code of the objects contained in this {@link ListOf}. 249 <p> 250 * LibSBML attaches an identifying code to every 251 * kind of SBML object. These are known as <em>SBML type codes</em>. In 252 * other languages, the set of type codes is stored in an enumeration; in 253 * the Java language interface for libSBML, the type codes are defined as 254 * static integer constants in the interface class {@link 255 * libsbmlConstants}. The names of the type codes all begin with the 256 * characters <code>SBML_.</code> 257 <p> 258 * @return the SBML type code for the objects contained in this {@link ListOf} 259 * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 260 */ public 261 int getItemTypeCode() { 262 return libsbmlJNI.ListOfLocalRenderInformation_getItemTypeCode(swigCPtr, this); 263 } 264 265 266/** */ public 267 boolean isValidTypeForList(SBase item) { 268 return libsbmlJNI.ListOfLocalRenderInformation_isValidTypeForList(swigCPtr, this, SBase.getCPtrAndDisown(item), item); 269 } 270 271}