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-layout"><a href="group__layout.html">layout</a></span> 013 014 A list of {@link LineSegment} objects. 015 <p> 016 * The {@link ListOfLineSegments} is a container for the {@link LineSegment} elements of a {@link Curve}. 017 <p> 018 * <p> 019 * The various ListOf___ classes in SBML 020 * are merely containers used for organizing the main components of an SBML 021 * model. In libSBML's implementation, ListOf___ 022 * classes are derived from the 023 * intermediate utility class {@link ListOf}, which 024 * is not defined by the SBML specifications but serves as a useful 025 * programmatic construct. {@link ListOf} is itself is in turn derived from {@link SBase}, 026 * which provides all of the various ListOf___ 027 * classes with common features 028 * defined by the SBML specification, such as 'metaid' attributes and 029 * annotations. 030 <p> 031 * Readers may wonder about the motivations for using the ListOf___ 032 * containers in SBML. A simpler approach in XML might be to place the 033 * components all directly at the top level of the model definition. The 034 * choice made in SBML is to group them within XML elements named after 035 * ListOf<em>Classname</em>, in part because it helps organize the 036 * components. More importantly, the fact that the container classes are 037 * derived from {@link SBase} means that software tools can add information <em>about</em> 038 * the lists themselves into each list container's 'annotation'. 039 <p> 040 * @see ListOfFunctionDefinitions 041 * @see ListOfUnitDefinitions 042 * @see ListOfCompartmentTypes 043 * @see ListOfSpeciesTypes 044 * @see ListOfCompartments 045 * @see ListOfSpecies 046 * @see ListOfParameters 047 * @see ListOfInitialAssignments 048 * @see ListOfRules 049 * @see ListOfConstraints 050 * @see ListOfReactions 051 * @see ListOfEvents 052 <p> 053 * @see Input 054 */ 055 056public class ListOfLineSegments extends ListOf { 057 private long swigCPtr; 058 059 protected ListOfLineSegments(long cPtr, boolean cMemoryOwn) 060 { 061 super(libsbmlJNI.ListOfLineSegments_SWIGUpcast(cPtr), cMemoryOwn); 062 swigCPtr = cPtr; 063 } 064 065 protected static long getCPtr(ListOfLineSegments obj) 066 { 067 return (obj == null) ? 0 : obj.swigCPtr; 068 } 069 070 protected static long getCPtrAndDisown (ListOfLineSegments obj) 071 { 072 long ptr = 0; 073 074 if (obj != null) 075 { 076 ptr = obj.swigCPtr; 077 obj.swigCMemOwn = false; 078 } 079 080 return ptr; 081 } 082 083 protected void finalize() { 084 delete(); 085 } 086 087 public synchronized void delete() { 088 if (swigCPtr != 0) { 089 if (swigCMemOwn) { 090 swigCMemOwn = false; 091 libsbmlJNI.delete_ListOfLineSegments(swigCPtr); 092 } 093 swigCPtr = 0; 094 } 095 super.delete(); 096 } 097 098 099/** 100 * Creates and returns a deep copy of this {@link ListOfLineSegments}. 101 <p> 102 * @return a (deep) copy of this {@link ListOfLineSegments}. 103 */ public 104 ListOfLineSegments cloneObject() { 105 long cPtr = libsbmlJNI.ListOfLineSegments_cloneObject(swigCPtr, this); 106 return (cPtr == 0) ? null : new ListOfLineSegments(cPtr, true); 107 } 108 109 110/** 111 * Ctor. 112 */ public 113 ListOfLineSegments(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 114 this(libsbmlJNI.new_ListOfLineSegments__SWIG_0(level, version, pkgVersion), true); 115 } 116 117 118/** 119 * Ctor. 120 */ public 121 ListOfLineSegments(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 122 this(libsbmlJNI.new_ListOfLineSegments__SWIG_1(level, version), true); 123 } 124 125 126/** 127 * Ctor. 128 */ public 129 ListOfLineSegments(long level) throws org.sbml.libsbml.SBMLConstructorException { 130 this(libsbmlJNI.new_ListOfLineSegments__SWIG_2(level), true); 131 } 132 133 134/** 135 * Ctor. 136 */ public 137 ListOfLineSegments() throws org.sbml.libsbml.SBMLConstructorException { 138 this(libsbmlJNI.new_ListOfLineSegments__SWIG_3(), true); 139 } 140 141 142/** 143 * Ctor. 144 */ public 145 ListOfLineSegments(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 146 this(libsbmlJNI.new_ListOfLineSegments__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 147 } 148 149 150/** 151 * Returns the libSBML type code for the SBML objects 152 * contained in this {@link ListOf} object. 153 <p> 154 * <p> 155 * LibSBML attaches an identifying code to every kind of SBML object. These 156 * are integer constants known as <em>SBML type codes</em>. The names of all 157 * the codes begin with the characters <code>SBML_</code>. 158 * In the Java language interface for libSBML, the 159 * type codes are defined as static integer constants in the interface class 160 * {@link libsbmlConstants}. Note that different Level 3 161 * package plug-ins may use overlapping type codes; to identify the package 162 * to which a given object belongs, call the <code>getPackageName()</code> 163 * method on the object. 164 <p> 165 * @return the SBML type code for objects contained in this list: 166 * {@link libsbmlConstants#SBML_LAYOUT_LINESEGMENT SBML_LAYOUT_LINESEGMENT} (default). 167 <p> 168 * @see #getElementName() 169 * @see #getPackageName() 170 */ public 171 int getItemTypeCode() { 172 return libsbmlJNI.ListOfLineSegments_getItemTypeCode(swigCPtr, this); 173 } 174 175 176/** 177 * Returns the XML element name of 178 * this SBML object. 179 <p> 180 * @return the string of the name of this element 181 */ public 182 String getElementName() { 183 return libsbmlJNI.ListOfLineSegments_getElementName(swigCPtr, this); 184 } 185 186 187/** 188 * Get a {@link LineSegment} from the {@link ListOfLineSegments}. 189 <p> 190 * @param n the index number of the {@link LineSegment} to get. 191 <p> 192 * @return the nth {@link LineSegment} in this {@link ListOfLineSegments}. 193 <p> 194 * @see #size() 195 */ public 196 LineSegment get(long n) { 197 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.ListOfLineSegments_get__SWIG_0(swigCPtr, this, n), false); 198} 199 200 201/** 202 * Removes the nth item from this {@link ListOfLineSegments} items and returns a pointer to 203 * it. 204 <p> 205 * The caller owns the returned item and is responsible for deleting it. 206 <p> 207 * @param n the index of the item to remove 208 <p> 209 * @see #size() 210 */ public 211 LineSegment remove(long n) { 212 return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.ListOfLineSegments_remove(swigCPtr, this, n), true); 213} 214 215 216/** 217 * Creates an {@link XMLNode} object from this. 218 */ public 219 XMLNode toXML() { 220 return new XMLNode(libsbmlJNI.ListOfLineSegments_toXML(swigCPtr, this), true); 221 } 222 223}