All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.nyu.acsys.CVC4.vectorCommandPtr Maven / Gradle / Ivy

Go to download

A self-unpacking, standalone CVC4 distribution that ships all required native support code and automatically unpacks it at runtime. Permissive-licensed version.

There is a newer version: 1.8
Show newest version
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.1
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package edu.nyu.acsys.CVC4;

public class vectorCommandPtr extends java.util.AbstractList implements java.util.RandomAccess {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected vectorCommandPtr(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

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

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

  public vectorCommandPtr(Command[] initialElements) {
    this();
    reserve(initialElements.length);

    for (Command element : initialElements) {
      add(element);
    }
  }

  public vectorCommandPtr(Iterable initialElements) {
    this();
    for (Command element : initialElements) {
      add(element);
    }
  }

  public Command get(int index) {
    return doGet(index);
  }

  public Command set(int index, Command e) {
    return doSet(index, e);
  }

  public boolean add(Command e) {
    modCount++;
    doAdd(e);
    return true;
  }

  public void add(int index, Command e) {
    modCount++;
    doAdd(index, e);
  }

  public Command remove(int index) {
    modCount++;
    return doRemove(index);
  }

  protected void removeRange(int fromIndex, int toIndex) {
    modCount++;
    doRemoveRange(fromIndex, toIndex);
  }

  public int size() {
    return doSize();
  }

  public vectorCommandPtr() {
    this(CVC4JNI.new_vectorCommandPtr__SWIG_0(), true);
  }

  public vectorCommandPtr(vectorCommandPtr other) {
    this(CVC4JNI.new_vectorCommandPtr__SWIG_1(vectorCommandPtr.getCPtr(other), other), true);
  }

  public long capacity() {
    return CVC4JNI.vectorCommandPtr_capacity(swigCPtr, this);
  }

  public void reserve(long n) {
    CVC4JNI.vectorCommandPtr_reserve(swigCPtr, this, n);
  }

  public boolean isEmpty() {
    return CVC4JNI.vectorCommandPtr_isEmpty(swigCPtr, this);
  }

  public void clear() {
    CVC4JNI.vectorCommandPtr_clear(swigCPtr, this);
  }

  public vectorCommandPtr(int count, Command value) {
    this(CVC4JNI.new_vectorCommandPtr__SWIG_2(count, Command.getCPtr(value), value), true);
  }

  private int doSize() {
    return CVC4JNI.vectorCommandPtr_doSize(swigCPtr, this);
  }

  private void doAdd(Command x) {
    CVC4JNI.vectorCommandPtr_doAdd__SWIG_0(swigCPtr, this, Command.getCPtr(x), x);
  }

  private void doAdd(int index, Command x) {
    CVC4JNI.vectorCommandPtr_doAdd__SWIG_1(swigCPtr, this, index, Command.getCPtr(x), x);
  }

  private Command doRemove(int index) {
    long cPtr = CVC4JNI.vectorCommandPtr_doRemove(swigCPtr, this, index);
    return (cPtr == 0) ? null : new Command(cPtr, false);
  }

  private Command doGet(int index) {
    long cPtr = CVC4JNI.vectorCommandPtr_doGet(swigCPtr, this, index);
    return (cPtr == 0) ? null : new Command(cPtr, false);
  }

  private Command doSet(int index, Command val) {
    long cPtr = CVC4JNI.vectorCommandPtr_doSet(swigCPtr, this, index, Command.getCPtr(val), val);
    return (cPtr == 0) ? null : new Command(cPtr, false);
  }

  private void doRemoveRange(int fromIndex, int toIndex) {
    CVC4JNI.vectorCommandPtr_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy