NVS Shapefile library Version 3.2
NVision Solutions, Inc.

com.nvs.shapefile
Class TableDescriptor

java.lang.Object
  |
  +--com.nvs.shapefile.TableDescriptor

public class TableDescriptor
extends java.lang.Object

TableDescriptor's populate a TableDescription and provide information about the field names, types, and widths for a Shapefile's records.

Author:
Zack Watts
NVisionSolutions, Inc.

Constructor Summary
TableDescriptor()
          Default constructor.
TableDescriptor(java.lang.String name)
          Initializes field name.
TableDescriptor(java.lang.String name, int type)
          Initializes to specified name and type.
TableDescriptor(java.lang.String name, int type, int width)
          Initializes to specified name, type, and width.
 
Method Summary
 java.lang.String getName()
          Retrieves the name of the field.
 int getPrecision()
          Retrieves the precision of the field.
 int getType()
          Retrieves the data type of the field.
 int getWidth()
          Retrieves the width of the field.
 void setName(java.lang.String name)
          Sets the specified field name.
 void setPrecision(int precision)
          Sets the specified field precision.
 void setType(int type)
          Sets the specified field type.
 void setWidth(int width)
          Sets the specified field width.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDescriptor

public TableDescriptor()
Default constructor. Field type defaults to Shapefile.FIELDTYPE_CHARACTER


TableDescriptor

public TableDescriptor(java.lang.String name)
Initializes field name. Field type defaults to type Shapefile.FIELDTYPE_CHARACTER

Parameters:
name - Desired name as a String

TableDescriptor

public TableDescriptor(java.lang.String name,
                       int type)
Initializes to specified name and type.

Parameters:
name - Desired name as a String
type - Desired type as an int

TableDescriptor

public TableDescriptor(java.lang.String name,
                       int type,
                       int width)
Initializes to specified name, type, and width.

Parameters:
name - Desired name as a String
type - Desired type as an int
width - Desired width as an int
Method Detail

getWidth

public int getWidth()
Retrieves the width of the field.

Returns:
Field width as an int

setWidth

public void setWidth(int width)
Sets the specified field width.

Parameters:
width - Desired field width as an int

getPrecision

public int getPrecision()
Retrieves the precision of the field.

Returns:
Field precision as an int

setPrecision

public void setPrecision(int precision)
Sets the specified field precision.

Parameters:
precision - Desired field precision as an int

getName

public java.lang.String getName()
Retrieves the name of the field.

Returns:
Field name as a String

getType

public int getType()
Retrieves the data type of the field. The field type will be one of Shapefile.FIELDTYPE_CHARACTER, Shapefile.FIELDTYPE_NUMBER, Shapefile.FIELDTYPE_FLOAT, Shapefile.FIELDTYPE_DATE, or Shapefile.FIELDTYPE_LOGICAL

Returns:
Field type as an int

setName

public void setName(java.lang.String name)
Sets the specified field name.

Parameters:
name - Desired field name as a String

setType

public void setType(int type)
             throws InvalidFieldTypeException
Sets the specified field type. The field type must be one of:
Shapefile.FIELDTYPE_CHARACTER
Shapefile.FIELDTYPE_NUMBER
Shapefile.FIELDTYPE_FLOAT
Shapefile.FIELDTYPE_DATE
Shapefile.FIELDTYPE_LOGICAL

Parameters:
type - Desired field type as an int
Throws:
InvalidFieldTypeException - when a type is specified that is not Shapefile.FIELDTYPE_CHARACTER, Shapefile.FIELDTYPE_NUMBER, Shapefile.FIELDTYPE_FLOAT, Shapefile.FIELDTYPE_DATE, or Shapefile.FIELDTYPE_LOGICAL

NVS Shapefile library Version 3.2
NVision Solutions, Inc.