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

package com.intel.analytics.bigdl.friesian.serving.recall.faiss.swighnswlib;

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;
  }

  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(LongVectorVector value) {
    swigfaissJNI.ArrayInvertedLists_ids_set(swigCPtr, this, LongVectorVector.getCPtr(value), value);
  }

  public LongVectorVector getIds() {
    long cPtr = swigfaissJNI.ArrayInvertedLists_ids_get(swigCPtr, this);
    return (cPtr == 0) ? null : new LongVectorVector(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 SWIGTYPE_p_long get_ids(long list_no) {
    long cPtr = swigfaissJNI.ArrayInvertedLists_get_ids(swigCPtr, this, list_no);
    return (cPtr == 0) ? null : new SWIGTYPE_p_long(cPtr, false);
  }

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

  public void update_entries(long list_no, long offset, long n_entry, SWIGTYPE_p_long ids, SWIGTYPE_p_unsigned_char code) {
    swigfaissJNI.ArrayInvertedLists_update_entries(swigCPtr, this, list_no, offset, n_entry, SWIGTYPE_p_long.getCPtr(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);
  }

}
