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

package org.gdal.ogr;

public class FieldDefn {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      ogrJNI.delete_FieldDefn(swigCPtr);
    }
    swigCPtr = 0;
  }

  protected static long getCPtrAndDisown(FieldDefn obj) {
    if (obj != null) obj.swigCMemOwn= false;
    return getCPtr(obj);
  }

  public FieldDefn(String name, int field_type) {
    this(ogrJNI.new_FieldDefn(name, field_type), true);
  }

  public String GetName() {
    return ogrJNI.FieldDefn_GetName(swigCPtr, this);
  }

  public String GetNameRef() {
    return ogrJNI.FieldDefn_GetNameRef(swigCPtr, this);
  }

  public void SetName(String name) {
    ogrJNI.FieldDefn_SetName(swigCPtr, this, name);
  }

  public int GetFieldType() {
    return ogrJNI.FieldDefn_GetFieldType(swigCPtr, this);
  }

  public void SetType(int type) {
    ogrJNI.FieldDefn_SetType(swigCPtr, this, type);
  }

  public int GetJustify() {
    return ogrJNI.FieldDefn_GetJustify(swigCPtr, this);
  }

  public void SetJustify(int justify) {
    ogrJNI.FieldDefn_SetJustify(swigCPtr, this, justify);
  }

  public int GetWidth() {
    return ogrJNI.FieldDefn_GetWidth(swigCPtr, this);
  }

  public void SetWidth(int width) {
    ogrJNI.FieldDefn_SetWidth(swigCPtr, this, width);
  }

  public int GetPrecision() {
    return ogrJNI.FieldDefn_GetPrecision(swigCPtr, this);
  }

  public void SetPrecision(int precision) {
    ogrJNI.FieldDefn_SetPrecision(swigCPtr, this, precision);
  }

  public String GetFieldTypeName(int type) {
    return ogrJNI.FieldDefn_GetFieldTypeName(swigCPtr, this, type);
  }

}
