/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.28
 *
 * 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 Feature {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

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

  public Feature(FeatureDefn feature_def) {
    this(ogrJNI.new_Feature(FeatureDefn.getCPtr(feature_def)), true);
  }

  public FeatureDefn GetDefnRef() {
    long cPtr = ogrJNI.Feature_GetDefnRef(swigCPtr);
    return (cPtr == 0) ? null : new FeatureDefn(cPtr, false);
  }

  public int SetGeometry(Geometry geom) {
    return ogrJNI.Feature_SetGeometry(swigCPtr, Geometry.getCPtr(geom));
  }

  public int SetGeometryDirectly(Geometry geom) {
    return ogrJNI.Feature_SetGeometryDirectly(swigCPtr, Geometry.getCPtrAndDisown(geom));
  }

  public Geometry GetGeometryRef() {
    long cPtr = ogrJNI.Feature_GetGeometryRef(swigCPtr);
    return (cPtr == 0) ? null : new Geometry(cPtr, false);
  }

  public Feature Clone() {
    long cPtr = ogrJNI.Feature_Clone(swigCPtr);
    return (cPtr == 0) ? null : new Feature(cPtr, true);
  }

  public boolean Equal(Feature feature) {
    return ogrJNI.Feature_Equal(swigCPtr, Feature.getCPtr(feature));
  }

  public int GetFieldCount() {
    return ogrJNI.Feature_GetFieldCount(swigCPtr);
  }

  public FieldDefn GetFieldDefnRef(int id) {
    long cPtr = ogrJNI.Feature_GetFieldDefnRef__SWIG_0(swigCPtr, id);
    return (cPtr == 0) ? null : new FieldDefn(cPtr, false);
  }

  public FieldDefn GetFieldDefnRef(String name) {
    long cPtr = ogrJNI.Feature_GetFieldDefnRef__SWIG_1(swigCPtr, name);
    return (cPtr == 0) ? null : new FieldDefn(cPtr, false);
  }

  public String GetFieldAsString(int id) {
    return ogrJNI.Feature_GetFieldAsString__SWIG_0(swigCPtr, id);
  }

  public String GetFieldAsString(String name) {
    return ogrJNI.Feature_GetFieldAsString__SWIG_1(swigCPtr, name);
  }

  public int GetFieldAsInteger(int id) {
    return ogrJNI.Feature_GetFieldAsInteger__SWIG_0(swigCPtr, id);
  }

  public int GetFieldAsInteger(String name) {
    return ogrJNI.Feature_GetFieldAsInteger__SWIG_1(swigCPtr, name);
  }

  public double GetFieldAsDouble(int id) {
    return ogrJNI.Feature_GetFieldAsDouble__SWIG_0(swigCPtr, id);
  }

  public double GetFieldAsDouble(String name) {
    return ogrJNI.Feature_GetFieldAsDouble__SWIG_1(swigCPtr, name);
  }

  public boolean IsFieldSet(int id) {
    return ogrJNI.Feature_IsFieldSet__SWIG_0(swigCPtr, id);
  }

  public boolean IsFieldSet(String name) {
    return ogrJNI.Feature_IsFieldSet__SWIG_1(swigCPtr, name);
  }

  public int GetFieldIndex(String name) {
    return ogrJNI.Feature_GetFieldIndex(swigCPtr, name);
  }

  public int GetFID() {
    return ogrJNI.Feature_GetFID(swigCPtr);
  }

  public int SetFID(int fid) {
    return ogrJNI.Feature_SetFID(swigCPtr, fid);
  }

  public void DumpReadable() {
    ogrJNI.Feature_DumpReadable(swigCPtr);
  }

  public void UnsetField(int id) {
    ogrJNI.Feature_UnsetField__SWIG_0(swigCPtr, id);
  }

  public void UnsetField(String name) {
    ogrJNI.Feature_UnsetField__SWIG_1(swigCPtr, name);
  }

  public void SetField(int id, String value) {
    ogrJNI.Feature_SetField__SWIG_0(swigCPtr, id, value);
  }

  public void SetField(String name, String value) {
    ogrJNI.Feature_SetField__SWIG_1(swigCPtr, name, value);
  }

  public void SetField(int id, int value) {
    ogrJNI.Feature_SetField__SWIG_2(swigCPtr, id, value);
  }

  public void SetField(String name, int value) {
    ogrJNI.Feature_SetField__SWIG_3(swigCPtr, name, value);
  }

  public void SetField(int id, double value) {
    ogrJNI.Feature_SetField__SWIG_4(swigCPtr, id, value);
  }

  public void SetField(String name, double value) {
    ogrJNI.Feature_SetField__SWIG_5(swigCPtr, name, value);
  }

  public void SetField(int id, int year, int month, int day, int hour, int minute, int second, int tzflag) {
    ogrJNI.Feature_SetField__SWIG_6(swigCPtr, id, year, month, day, hour, minute, second, tzflag);
  }

  public void SetField(String name, int year, int month, int day, int hour, int minute, int second, int tzflag) {
    ogrJNI.Feature_SetField__SWIG_7(swigCPtr, name, year, month, day, hour, minute, second, tzflag);
  }

  public int SetFrom(Feature other, int forgiving) {
    return ogrJNI.Feature_SetFrom(swigCPtr, Feature.getCPtr(other), forgiving);
  }

  public String GetStyleString() {
    return ogrJNI.Feature_GetStyleString(swigCPtr);
  }

  public void SetStyleString(String the_string) {
    ogrJNI.Feature_SetStyleString(swigCPtr, the_string);
  }

  public int GetFieldType(int id) {
    return ogrJNI.Feature_GetFieldType__SWIG_0(swigCPtr, id);
  }

  public int GetFieldType(String name) {
    return ogrJNI.Feature_GetFieldType__SWIG_1(swigCPtr, name);
  }

}
