package clucene;
public class _CL_p_int32_tArray {

  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      CLjavaJNI.delete__CL_p_int32_tArray(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _CL_p_int32_tArray(int[] val) {
    this(CLjavaJNI.new__CL_p_int32_tArray(), true);
    
		int size=val.length;
		this.init(size);
		for ( int i=0;i<size;i++ )
			this.set(val[i],i);
  }
  
  
  public int[] toArray()
	{
		int len = this.length();
		int[] ret = new int[len];
		for ( int i=0;i<len;i++ )
			ret[i]=get(i);
		return ret;
	}

  public int length() {
    return CLjavaJNI._CL_p_int32_tArray_length(swigCPtr);
  }

  public void init(int len) {
    CLjavaJNI._CL_p_int32_tArray_init(swigCPtr, len);
  }

  public int get(int idx) {
    return CLjavaJNI._CL_p_int32_tArray_get(swigCPtr, idx);
  }

  public void set(int a, int i) {
    CLjavaJNI._CL_p_int32_tArray_set(swigCPtr, a, i);
  }

}
