Package org.gdal.ogr

## Class FieldDefn

- java.lang.Object
- - org.gdal.ogr.FieldDefn

-     public class FieldDefn
      extends java.lang.Object

  Definition of an attribute of a FeatureDefn.

  The FieldDefn class is a binding for the C++ OGRFieldDefn class.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FieldDefn()` | Constructor.
    `FieldDefn​(java.lang.String name)` | Constructor.
    `FieldDefn​(java.lang.String name, int field_type)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `delete()` |
    `boolean` | `equals​(java.lang.Object obj)` |
    `java.lang.String` | `GetAlternativeName()` |
    `byte[]` | `GetAlternativeNameAsByteArray()` |
    `java.lang.String` | `GetAlternativeNameRef()` |
    `java.lang.String` | `GetComment()` |
    `byte[]` | `GetCommentAsByteArray()` |
    `java.lang.String` | `GetDefault()` |
    `byte[]` | `GetDefaultAsByteArray()` |
    `java.lang.String` | `GetDomainName()` |
    `byte[]` | `GetDomainNameAsByteArray()` |
    `int` | `GetFieldType()` | Return the field type
    `java.lang.String` | `GetFieldTypeName​(int type)` | Fetch human readable name for a field type.
    `int` | `GetJustify()` | Get the justification for this field.
    `java.lang.String` | `GetName()` | Get the name of this field.
    `byte[]` | `GetNameAsByteArray()` |
    `java.lang.String` | `GetNameRef()` | Fetch name of this field.
    `int` | `GetPrecision()` | Get the formatting precision for this field.
    `int` | `GetSubType()` |
    `int` | `GetType()` |
    `java.lang.String` | `GetTypeName()` | Fetch human readable name for the field
    `int` | `GetTZFlag()` |
    `int` | `GetWidth()` | Get the formatting width for this field.
    `int` | `hashCode()` |
    `int` | `IsDefaultDriverSpecific()` |
    `int` | `IsGenerated()` |
    `int` | `IsIgnored()` | Return whether this field should be omitted when fetching features.
    `int` | `IsNullable()` |
    `int` | `IsUnique()` |
    `void` | `SetAlternativeName​(java.lang.String alternativeName)` |
    `void` | `SetComment​(java.lang.String comment)` |
    `void` | `SetDefault​(java.lang.String pszValue)` |
    `void` | `SetDomainName​(java.lang.String name)` |
    `void` | `SetGenerated​(int bGenerated)` |
    `void` | `SetIgnored​(int bIgnored)` | Set whether this field should be omitted when fetching features.
    `void` | `SetJustify​(int justify)` | Set the justification for this field.
    `void` | `SetName​(java.lang.String name)` | Reset the name of this field.
    `void` | `SetNullable​(int bNullable)` |
    `void` | `SetPrecision​(int precision)` | Set the formatting precision for this field in characters.
    `void` | `SetSubType​(int type)` |
    `void` | `SetType​(int type)` | Set the type of this field.
    `void` | `SetTZFlag​(int tzflag)` |
    `void` | `SetUnique​(int bUnique)` |
    `void` | `SetWidth​(int width)` | Set the formatting width for this field in characters.

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FieldDefn

          public FieldDefn​(java.lang.String name,
                           int field_type)

      Constructor.
      Parameters:
        `name` - the name of the new field.
        `field_type` - the type of the new field.

    - #### FieldDefn

          public FieldDefn​(java.lang.String name)

      Constructor.

      The new field will be of type OFTString

      Parameters:
        `name` - the name of the new field.

    - #### FieldDefn

          public FieldDefn()

      Constructor.

      The new field will be named "unnamed" and of type OFTString

  - ### Method Detail

    - #### delete

          public void delete()

    - #### equals

          public boolean equals​(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### GetName

          public java.lang.String GetName()

      Get the name of this field.
      Returns:
        the name of the field

    - #### GetNameAsByteArray

          public byte[] GetNameAsByteArray()

    - #### GetNameRef

          public java.lang.String GetNameRef()

      Fetch name of this field.
      Returns:
        the name of the field

    - #### SetName

          public void SetName​(java.lang.String name)

      Reset the name of this field.
      Parameters:
        `name` - the new name to apply.

    - #### GetAlternativeName

          public java.lang.String GetAlternativeName()

    - #### GetAlternativeNameAsByteArray

          public byte[] GetAlternativeNameAsByteArray()

    - #### GetAlternativeNameRef

          public java.lang.String GetAlternativeNameRef()

    - #### SetAlternativeName

          public void SetAlternativeName​(java.lang.String alternativeName)

    - #### GetType

          public int GetType()

    - #### SetType

          public void SetType​(int type)

      Set the type of this field.

      This should never be done to an FieldDefn that is already part of an FeatureDefn.

      Parameters:
        `type` - the new field type.

    - #### GetFieldType

          public int GetFieldType()

      Return the field type
      Returns:
        the field type

    - #### GetSubType

          public int GetSubType()

    - #### SetSubType

          public void SetSubType​(int type)

    - #### GetJustify

          public int GetJustify()

      Get the justification for this field.
      Returns:
        the justification.

    - #### SetJustify

          public void SetJustify​(int justify)

      Set the justification for this field.
      Parameters:
        `justify` - the new justification.

    - #### GetWidth

          public int GetWidth()

      Get the formatting width for this field.
      Returns:
        the width, zero means no specified width.

    - #### SetWidth

          public void SetWidth​(int width)

      Set the formatting width for this field in characters.
      Parameters:
        `width` - the new width.

    - #### GetPrecision

          public int GetPrecision()

      Get the formatting precision for this field.

      This should normally be zero for fields of types other than OFTReal.

      Returns:
        the precision.

    - #### SetPrecision

          public void SetPrecision​(int precision)

      Set the formatting precision for this field in characters.

      This should normally be zero for fields of types other than OFTReal.

      Parameters:
        `precision` - the new precision.

    - #### GetTZFlag

          public int GetTZFlag()

    - #### SetTZFlag

          public void SetTZFlag​(int tzflag)

    - #### GetTypeName

          public java.lang.String GetTypeName()

      Fetch human readable name for the field
      Returns:
        field type name

    - #### GetFieldTypeName

          public java.lang.String GetFieldTypeName​(int type)

      Fetch human readable name for a field type.
      Parameters:
        `type` - the field type to get name for.
      Returns:
        field type name

    - #### IsIgnored

          public int IsIgnored()

      Return whether this field should be omitted when fetching features.
      Returns:
        ignore state (1 if ignored, 0 otherwise)

    - #### SetIgnored

          public void SetIgnored​(int bIgnored)

      Set whether this field should be omitted when fetching features.
      Parameters:
        `bIgnored` - ignore state (1 to ignore, 0 otherwise)

    - #### IsNullable

          public int IsNullable()

    - #### SetNullable

          public void SetNullable​(int bNullable)

    - #### IsUnique

          public int IsUnique()

    - #### SetUnique

          public void SetUnique​(int bUnique)

    - #### IsGenerated

          public int IsGenerated()

    - #### SetGenerated

          public void SetGenerated​(int bGenerated)

    - #### GetDefault

          public java.lang.String GetDefault()

    - #### GetDefaultAsByteArray

          public byte[] GetDefaultAsByteArray()

    - #### SetDefault

          public void SetDefault​(java.lang.String pszValue)

    - #### IsDefaultDriverSpecific

          public int IsDefaultDriverSpecific()

    - #### GetDomainName

          public java.lang.String GetDomainName()

    - #### GetDomainNameAsByteArray

          public byte[] GetDomainNameAsByteArray()

    - #### SetDomainName

          public void SetDomainName​(java.lang.String name)

    - #### GetComment

          public java.lang.String GetComment()

    - #### GetCommentAsByteArray

          public byte[] GetCommentAsByteArray()

    - #### SetComment

          public void SetComment​(java.lang.String comment)