NVS Shapefile library Version 3.2
NVision Solutions, Inc.

com.nvs.shapefile
Class Record

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

public class Record
extends java.lang.Object

Records contain an internal Collection of RecordFields and store the database attributes for a given shape.

Author:
Zack Watts
NVisionSolutions, Inc.

Constructor Summary
Record()
          Default constructor.
Record(java.util.Collection fields)
          Initializes the Record to the specified collection of RecordFields.
 
Method Summary
 void addField(com.nvs.shapefile.RecordField fld)
          Adds the specified RecordField.
 com.nvs.shapefile.RecordField getField(int index)
          Retrieves the RecordField at the specified index.
 com.nvs.shapefile.RecordField getField(java.lang.String name)
          Retrieves the RecordField with specified name.
 int getFieldCount()
          Retrieves the current number of RecordFields
 java.util.ArrayList getFields()
          Retrieves all RecordFields as an ArrayList
 void removeField(int index)
          Removes the RecordField at the specified index.
 void removeField(java.lang.String name)
          Removes the RecordField with the supplied name.
 void setField(com.nvs.shapefile.RecordField fld)
          Sets value of RecordField with the name of fld.getName().
 void setFields(java.util.Collection fields)
          Sets the internal Collection of RecordFields to the specified Collection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Record

public Record()
Default constructor.


Record

public Record(java.util.Collection fields)
Initializes the Record to the specified collection of RecordFields.

Parameters:
fields - Desired RecordFields as a Collection.
Method Detail

setField

public void setField(com.nvs.shapefile.RecordField fld)
              throws InvalidFieldNameException
Sets value of RecordField with the name of fld.getName().

Parameters:
fld - RecordField with desired name and new value
Throws:
InvalidFieldNameException - when fld.getName() does not equal the name of an existing RecordField

setFields

public void setFields(java.util.Collection fields)
Sets the internal Collection of RecordFields to the specified Collection

Parameters:
fields - New Collection of RecordFields

addField

public void addField(com.nvs.shapefile.RecordField fld)
              throws InvalidFieldNameException
Adds the specified RecordField.

Parameters:
fld - RecordField to be added
Throws:
InvalidFieldNameException - when fld.getName() equals the name of an already existing RecordField

removeField

public void removeField(java.lang.String name)
                 throws InvalidFieldNameException
Removes the RecordField with the supplied name.

Parameters:
name - Name of RecordField to be removed as a String
Throws:
InvalidFieldNameException - when no RecordField with supplied name exists.

removeField

public void removeField(int index)
                 throws java.lang.IndexOutOfBoundsException
Removes the RecordField at the specified index.

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

getField

public com.nvs.shapefile.RecordField getField(java.lang.String name)
Retrieves the RecordField with specified name.

Parameters:
name - Name of desired RecordField as a String
Returns:
RecordField with the specified name, or null if no RecordField exists with the specified name

getField

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

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

getFields

public java.util.ArrayList getFields()
Retrieves all RecordFields as an ArrayList

Returns:
All RecordFields as an ArrayList

getFieldCount

public int getFieldCount()
Retrieves the current number of RecordFields

Returns:
Current number of record fields as an int

NVS Shapefile library Version 3.2
NVision Solutions, Inc.