001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.7 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 to store {@link LineEnding} objects 013 <p> 014 * Each RenderInformation object can contain its own {@link ListOfLineEndings} object. 015 */ 016 017public class ListOfLineEndings extends ListOf { 018 private long swigCPtr; 019 020 protected ListOfLineEndings(long cPtr, boolean cMemoryOwn) 021 { 022 super(libsbmlJNI.ListOfLineEndings_SWIGUpcast(cPtr), cMemoryOwn); 023 swigCPtr = cPtr; 024 } 025 026 protected static long getCPtr(ListOfLineEndings obj) 027 { 028 return (obj == null) ? 0 : obj.swigCPtr; 029 } 030 031 protected static long getCPtrAndDisown (ListOfLineEndings obj) 032 { 033 long ptr = 0; 034 035 if (obj != null) 036 { 037 ptr = obj.swigCPtr; 038 obj.swigCMemOwn = false; 039 } 040 041 return ptr; 042 } 043 044 protected void finalize() { 045 delete(); 046 } 047 048 public synchronized void delete() { 049 if (swigCPtr != 0) { 050 if (swigCMemOwn) { 051 swigCMemOwn = false; 052 libsbmlJNI.delete_ListOfLineEndings(swigCPtr); 053 } 054 swigCPtr = 0; 055 } 056 super.delete(); 057 } 058 059 060/** 061 * Creates and returns a deep copy of the {@link ListOfLineEndings} object. 062 <p> 063 * @return a (deep) copy of this {@link ListOfLineEndings} 064 */ public 065 ListOfLineEndings cloneObject() { 066 long cPtr = libsbmlJNI.ListOfLineEndings_cloneObject(swigCPtr, this); 067 return (cPtr == 0) ? null : new ListOfLineEndings(cPtr, true); 068 } 069 070 071/** 072 * Creates a new {@link ListOfLineEndings} object from the given {@link XMLNode} object. 073 * The {@link XMLNode} object has to contain a valid XML representation of a 074 * {@link ListOfLineEndings} object as defined in the render extension specification. 075 * This method is normally called when render information is read from a file and 076 * should normally not have to be called explicitly. 077 <p> 078 * @param node the {@link XMLNode} object reference that describes the {@link ListOfLineEndings} 079 * object to be instantiated. 080 */ public 081 ListOfLineEndings(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException { 082 this(libsbmlJNI.new_ListOfLineEndings__SWIG_0(XMLNode.getCPtr(node), node, l2version), true); 083 } 084 085 086/** 087 * Creates a new {@link ListOfLineEndings} object from the given {@link XMLNode} object. 088 * The {@link XMLNode} object has to contain a valid XML representation of a 089 * {@link ListOfLineEndings} object as defined in the render extension specification. 090 * This method is normally called when render information is read from a file and 091 * should normally not have to be called explicitly. 092 <p> 093 * @param node the {@link XMLNode} object reference that describes the {@link ListOfLineEndings} 094 * object to be instantiated. 095 */ public 096 ListOfLineEndings(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException { 097 this(libsbmlJNI.new_ListOfLineEndings__SWIG_1(XMLNode.getCPtr(node), node), true); 098 } 099 100 101/** 102 * Constructor which instantiates an empty {@link ListOfLineEndings} object. 103 */ public 104 ListOfLineEndings(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 105 this(libsbmlJNI.new_ListOfLineEndings__SWIG_2(level, version, pkgVersion), true); 106 } 107 108 109/** 110 * Constructor which instantiates an empty {@link ListOfLineEndings} object. 111 */ public 112 ListOfLineEndings(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 113 this(libsbmlJNI.new_ListOfLineEndings__SWIG_3(level, version), true); 114 } 115 116 117/** 118 * Constructor which instantiates an empty {@link ListOfLineEndings} object. 119 */ public 120 ListOfLineEndings(long level) throws org.sbml.libsbml.SBMLConstructorException { 121 this(libsbmlJNI.new_ListOfLineEndings__SWIG_4(level), true); 122 } 123 124 125/** 126 * Constructor which instantiates an empty {@link ListOfLineEndings} object. 127 */ public 128 ListOfLineEndings() throws org.sbml.libsbml.SBMLConstructorException { 129 this(libsbmlJNI.new_ListOfLineEndings__SWIG_5(), true); 130 } 131 132 133/** 134 * Ctor. 135 */ public 136 ListOfLineEndings(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException { 137 this(libsbmlJNI.new_ListOfLineEndings__SWIG_6(RenderPkgNamespaces.getCPtr(renderns), renderns), true); 138 } 139 140 141/** 142 * Copy constructor. Creates a copy of this {@link ListOfLineEndings} object. 143 */ public 144 ListOfLineEndings(ListOfLineEndings source) throws org.sbml.libsbml.SBMLConstructorException { 145 this(libsbmlJNI.new_ListOfLineEndings__SWIG_7(ListOfLineEndings.getCPtr(source), source), true); 146 } 147 148 149/** 150 * Returns the XML element name of this object, which for 151 * {@link ListOfLineEndings}, is always <code>'listOfLineEndings'.</code> 152 <p> 153 * @return the name of this element, i.e., <code>'listOfLineEndings'.</code> 154 */ public 155 String getElementName() { 156 return libsbmlJNI.ListOfLineEndings_getElementName(swigCPtr, this); 157 } 158 159 160/** 161 * Creates an {@link XMLNode} object from this {@link ListOfLineEndings} object. 162 <p> 163 * @return the {@link XMLNode} with the XML representation for the 164 * {@link ListOfLineEndings} object. 165 */ public 166 XMLNode toXML() { 167 return new XMLNode(libsbmlJNI.ListOfLineEndings_toXML(swigCPtr, this), true); 168 } 169 170 171/** 172 * Returns a pointer to the {@link LineEnding} with the given index or null if 173 * the index is invalid. 174 <p> 175 * @param i index of the {@link LineEnding} object to be returned 176 <p> 177 * @return pointer to the {@link LineEnding} at the given index or null. 178 */ public 179 LineEnding get(long i) { 180 long cPtr = libsbmlJNI.ListOfLineEndings_get__SWIG_0(swigCPtr, this, i); 181 return (cPtr == 0) ? null : new LineEnding(cPtr, false); 182 } 183 184 185/** 186 * Returns a pointer to the {@link LineEnding} with the given <code>id</code> or <code>null</code> if 187 * the id is invalid. 188 <p> 189 * @param id id of the {@link LineEnding} object to be returned 190 <p> 191 * @return pointer to the {@link LineEnding} at the given <code>id</code> or <code>null.</code> 192 */ public 193 LineEnding get(String id) { 194 long cPtr = libsbmlJNI.ListOfLineEndings_get__SWIG_2(swigCPtr, this, id); 195 return (cPtr == 0) ? null : new LineEnding(cPtr, false); 196 } 197 198 199/** 200 * Removes the nth item from this {@link ListOfLineEndings} items and returns a pointer to 201 * it. 202 <p> 203 * The caller owns the returned item and is responsible for deleting it. 204 <p> 205 * @param n the index of the item to remove 206 <p> 207 * @see #size() 208 */ public 209 LineEnding remove(long n) { 210 long cPtr = libsbmlJNI.ListOfLineEndings_remove__SWIG_0(swigCPtr, this, n); 211 return (cPtr == 0) ? null : new LineEnding(cPtr, true); 212 } 213 214 215/** 216 * Removes item in this {@link ListOfLineEndings} items with the given identifier. 217 <p> 218 * The caller owns the returned item and is responsible for deleting it. 219 * If none of the items in this list have the identifier <code>sid</code>, then @c 220 * null is returned. 221 <p> 222 * @param sid the identifier of the item to remove 223 <p> 224 * @return the item removed. As mentioned above, the caller owns the 225 * returned item. 226 */ public 227 LineEnding remove(String sid) { 228 long cPtr = libsbmlJNI.ListOfLineEndings_remove__SWIG_1(swigCPtr, this, sid); 229 return (cPtr == 0) ? null : new LineEnding(cPtr, true); 230 } 231 232 233/** 234 * Get the type code of the objects contained in this {@link ListOf}. 235 <p> 236 * LibSBML attaches an identifying code to every 237 * kind of SBML object. These are known as <em>SBML type codes</em>. In 238 * other languages, the set of type codes is stored in an enumeration; in 239 * the Java language interface for libSBML, the type codes are defined as 240 * static integer constants in the interface class {@link 241 * libsbmlConstants}. The names of the type codes all begin with the 242 * characters <code>SBML_.</code> 243 <p> 244 * @return the SBML type code for the objects contained in this {@link ListOf} 245 * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 246 */ public 247 int getItemTypeCode() { 248 return libsbmlJNI.ListOfLineEndings_getItemTypeCode(swigCPtr, this); 249 } 250 251}