/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.opensim.modeling;

/**
 *  A convenient struct for anything requiring an offset and length to specify<br>
 * a segment of some larger sequence. *
 */
public class Segment {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  public Segment(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(Segment obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        opensimSimbodyJNI.delete_Segment(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public Segment() {
    this(opensimSimbodyJNI.new_Segment__SWIG_0(), true);
  }

  public Segment(int l, int ofs) {
    this(opensimSimbodyJNI.new_Segment__SWIG_1(l, ofs), true);
  }

  public Segment(int l) {
    this(opensimSimbodyJNI.new_Segment__SWIG_2(l), true);
  }

  public void setLength(int value) {
    opensimSimbodyJNI.Segment_length_set(swigCPtr, this, value);
  }

  public int getLength() {
    return opensimSimbodyJNI.Segment_length_get(swigCPtr, this);
  }

  public void setOffset(int value) {
    opensimSimbodyJNI.Segment_offset_set(swigCPtr, this, value);
  }

  public int getOffset() {
    return opensimSimbodyJNI.Segment_offset_get(swigCPtr, this);
  }

}
