/* ----------------------------------------------------------------------------
 * 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 ArrayInvertedLists extends InvertedLists {
  private transient long swigCPtr;

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

  protected static long getCPtr(ArrayInvertedLists 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_ArrayInvertedLists(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setCodes(ByteVectorVector value) {
    swigfaissJNI.ArrayInvertedLists_codes_set(swigCPtr, this, ByteVectorVector.getCPtr(value), value);
  }

  public ByteVectorVector getCodes() {
    long cPtr = swigfaissJNI.ArrayInvertedLists_codes_get(swigCPtr, this);
    return (cPtr == 0) ? null : new ByteVectorVector(cPtr, false);
  }

  public void setIds(SWIGTYPE_p_std__vectorT_std__vectorT_int64_t_t_t value) {
    swigfaissJNI.ArrayInvertedLists_ids_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_std__vectorT_int64_t_t_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_std__vectorT_int64_t_t_t getIds() {
    long cPtr = swigfaissJNI.ArrayInvertedLists_ids_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_std__vectorT_int64_t_t_t(cPtr, false);
  }

  public ArrayInvertedLists(long nlist, long code_size) {
    this(swigfaissJNI.new_ArrayInvertedLists(nlist, code_size), true);
  }

  public long list_size(long list_no) {
    return swigfaissJNI.ArrayInvertedLists_list_size(swigCPtr, this, list_no);
  }

  public SWIGTYPE_p_unsigned_char get_codes(long list_no) {
    long cPtr = swigfaissJNI.ArrayInvertedLists_get_codes(swigCPtr, this, list_no);
    return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
  }

  public LongVector get_ids(long list_no) {
    return new LongVector(swigfaissJNI.ArrayInvertedLists_get_ids(swigCPtr, this, list_no), false);
}

  public long add_entries(long list_no, long n_entry, LongVector ids, SWIGTYPE_p_unsigned_char code) {
    return swigfaissJNI.ArrayInvertedLists_add_entries(swigCPtr, this, list_no, n_entry, SWIGTYPE_p_long_long.getCPtr(ids.data()), ids, SWIGTYPE_p_unsigned_char.getCPtr(code));
  }

  public void update_entries(long list_no, long offset, long n_entry, LongVector ids, SWIGTYPE_p_unsigned_char code) {
    swigfaissJNI.ArrayInvertedLists_update_entries(swigCPtr, this, list_no, offset, n_entry, SWIGTYPE_p_long_long.getCPtr(ids.data()), ids, SWIGTYPE_p_unsigned_char.getCPtr(code));
  }

  public void resize(long list_no, long new_size) {
    swigfaissJNI.ArrayInvertedLists_resize(swigCPtr, this, list_no, new_size);
  }

}
