NVS Shapefile library Version 3.2
NVision Solutions, Inc.

com.nvs.shapefile
Class TableDescription

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

public class TableDescription
extends java.lang.Object


Constructor Summary
TableDescription()
          Default constructor.
TableDescription(java.util.Collection descriptors)
          Initializes with the specified Collection of TableDescriptors.
 
Method Summary
 void addTableDescriptor(com.nvs.shapefile.TableDescriptor td)
          Adds the specified TableDescriptor.
 boolean contains(java.lang.String name)
           
 int getFieldCount()
          Retrieves the current number of TableDescriptors.
 com.nvs.shapefile.TableDescriptor getTableDescriptor(int index)
          Retrieves the TableDescriptor at the specified index.
 com.nvs.shapefile.TableDescriptor getTableDescriptor(java.lang.String name)
          Retrieves the TableDescriptor with the specified name.
 java.util.ArrayList getTableDescriptors()
          Retrieves all TableDescriptors.
 void removeTableDescriptor(int index)
          Removes the TableDescriptor at the specified index.
 void removeTableDescriptor(java.lang.String name)
          Removes the TableDescriptor with the specified name.
 void setTableDescriptors(java.util.Collection descriptors)
          Sets interal TableDescriptors Collection to specified Collection.
 void setTableDescriptorType(java.lang.String name, int type)
          Sets type of TableDescriptor with specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableDescription

public TableDescription()
Default constructor.


TableDescription

public TableDescription(java.util.Collection descriptors)
Initializes with the specified Collection of TableDescriptors.

Method Detail

getTableDescriptor

public com.nvs.shapefile.TableDescriptor getTableDescriptor(java.lang.String name)
Retrieves the TableDescriptor with the specified name. If no TableDescriptor exists with the specified name, null is returned.

Parameters:
name - Name of desired TableDescriptor as a String
Returns:
TableDescriptor with specified name, or null if none exists

getTableDescriptor

public com.nvs.shapefile.TableDescriptor getTableDescriptor(int index)
                                                     throws java.lang.IndexOutOfBoundsException
Retrieves the TableDescriptor at the specified index.

Parameters:
index - Index of desired TableDescriptor as an int
Returns:
TableDescriptor at specified index
Throws:
java.lang.IndexOutOfBoundsException - if specified index is greater than getFieldCount()

getTableDescriptors

public java.util.ArrayList getTableDescriptors()
Retrieves all TableDescriptors.

Returns:
all TableDescriptors as an ArrayList

setTableDescriptorType

public void setTableDescriptorType(java.lang.String name,
                                   int type)
                            throws InvalidDescriptorNameException,
                                   InvalidFieldTypeException
Sets type of TableDescriptor with specified name.

Parameters:
name - Name of desired TableDescriptor as a String
type - Type of desired TableDescriptor as an int
The field type must be one of:
Shapefile.FIELDTYPE_CHARACTER
Shapefile.FIELDTYPE_NUMBER
Shapefile.FIELDTYPE_FLOAT
Shapefile.FIELDTYPE_DATE
Shapefile.FIELDTYPE_LOGICAL
Throws:
InvalidDescriptorNameException - when name is not currently the name of an existing TableDescriptor
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

addTableDescriptor

public void addTableDescriptor(com.nvs.shapefile.TableDescriptor td)
                        throws InvalidDescriptorNameException
Adds the specified TableDescriptor.

Parameters:
td - TableDescriptor to be added
Throws:
InvalidDescriptorNameException - when td.getName() is already the name of a currently existing TableDescriptor, or is null

getFieldCount

public int getFieldCount()
Retrieves the current number of TableDescriptors.

Returns:
the number of TableDescriptors as an int

setTableDescriptors

public void setTableDescriptors(java.util.Collection descriptors)
Sets interal TableDescriptors Collection to specified Collection.

Parameters:
descriptors - Desired TableDescriptors as a Collection

removeTableDescriptor

public void removeTableDescriptor(int index)
                           throws java.lang.IndexOutOfBoundsException
Removes the TableDescriptor at the specified index.

Parameters:
index - Index of TableDescriptor to be removed as an int
Throws:
java.lang.IndexOutOfBoundsException - when index is greater than getFieldCount()

removeTableDescriptor

public void removeTableDescriptor(java.lang.String name)
                           throws InvalidDescriptorNameException
Removes the TableDescriptor with the specified name.

Parameters:
name - Name of TableDescriptor to be removed as a String
Throws:
InvalidDescriptorNameException - when name doesn't correspond to the name of any existing TableDescriptor

contains

public boolean contains(java.lang.String name)

NVS Shapefile library Version 3.2
NVision Solutions, Inc.