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


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

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

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

  protected void finalize() {
    delete();
  }

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

  public Document() {
    this(CLjavaJNI.new_Document(), true);
  }

  public void add(Field field) {
    CLjavaJNI.Document_add(swigCPtr, Field.getCPtr(field));
  }

  public Field getField(String name) {
    long cPtr = CLjavaJNI.Document_getField(swigCPtr, name);
    return (cPtr == 0) ? null : new Field(cPtr, false);
  }

  public String get(String field) {
    return CLjavaJNI.Document_get(swigCPtr, field);
  }

  public DocumentFieldEnumeration fields() {
    long cPtr = CLjavaJNI.Document_fields(swigCPtr);
    return (cPtr == 0) ? null : new DocumentFieldEnumeration(cPtr, true);
  }

  public String toString() {
    return CLjavaJNI.Document_toString(swigCPtr);
  }

  public void setBoost(float boost) {
    CLjavaJNI.Document_setBoost(swigCPtr, boost);
  }

  public float getBoost() {
    return CLjavaJNI.Document_getBoost(swigCPtr);
  }

  public void removeField(String name) {
    CLjavaJNI.Document_removeField(swigCPtr, name);
  }

  public void removeFields(String name) {
    CLjavaJNI.Document_removeFields(swigCPtr, name);
  }

  public String[] getValues(String name) {
    return CLjavaJNI.Document_getValues(swigCPtr, name);
  }

}
