/* ----------------------------------------------------------------------------
 * 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 com.twitter.ann.faiss;

public class IDSelectorArray extends IDSelector {
  private transient long swigCPtr;

  protected IDSelectorArray(long cPtr, boolean cMemoryOwn) {
    super(swigfaissJNI.IDSelectorArray_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        swigfaissJNI.delete_IDSelectorArray(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setN(long value) {
    swigfaissJNI.IDSelectorArray_n_set(swigCPtr, this, value);
  }

  public long getN() {
    return swigfaissJNI.IDSelectorArray_n_get(swigCPtr, this);
  }

  public void setIds(LongVector value) {
    swigfaissJNI.IDSelectorArray_ids_set(swigCPtr, this, SWIGTYPE_p_long_long.getCPtr(value.data()), value);
  }

  public LongVector getIds() {
    return new LongVector(swigfaissJNI.IDSelectorArray_ids_get(swigCPtr, this), false);
}

  public IDSelectorArray(long n, LongVector ids) {
    this(swigfaissJNI.new_IDSelectorArray(n, SWIGTYPE_p_long_long.getCPtr(ids.data()), ids), true);
  }

  public boolean is_member(long id) {
    return swigfaissJNI.IDSelectorArray_is_member(swigCPtr, this, id);
  }

}
