ilog.views.maps.format.shapefile
Class IlvDBFWriter

java.lang.Object
  extended by ilog.views.maps.format.shapefile.IlvDBFWriter

public class IlvDBFWriter
extends Object

This class writes the attributes files in .dbf format.

The .dbf files contain the attributes of the map objects contained in a .shp file. The output format is dBASE III+ table file.

The basic usage of this writer is to create it, then call the writeAttribute method for all the attributes. Once all the attributes are written, the close method must be called in order to flush the data and write the file header.

Since:
JViews 5.0
See Also:
IlvDBFAttributeInfo, IlvSHPWriter

Constructor Summary
IlvDBFWriter(IlvDBFAttributeInfo info, String filename)
          Constructs a new .dbf Writer to write the attributes whose descriptor is specified.
IlvDBFWriter(IlvDBFAttributeInfo info, String filename, String encoding)
          Constructs a new .dbf Writer to write the attributes whose descriptor is specified, using the specified string encoding.
 
Method Summary
 void close()
          Closes this writer, flushing all data and writing the header.
 void writeAttributes(IlvFeatureAttributeProperty attributes)
          Writes the specified attributes as a new record in the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDBFWriter

public IlvDBFWriter(IlvDBFAttributeInfo info,
                    String filename)
             throws IOException
Constructs a new .dbf Writer to write the attributes whose descriptor is specified.

Parameters:
info - The attribute descriptor.
filename - The filename.
Throws:
IOException

IlvDBFWriter

public IlvDBFWriter(IlvDBFAttributeInfo info,
                    String filename,
                    String encoding)
             throws IOException
Constructs a new .dbf Writer to write the attributes whose descriptor is specified, using the specified string encoding.

Parameters:
info - The attribute descriptor.
filename - The filename.
encoding - The string encoding.
Throws:
IOException
Since:
JViews 6.0
Method Detail

close

public void close()
           throws IOException
Closes this writer, flushing all data and writing the header.

This method must be called once all the attributes are written, so that the header is updated.

Throws:
IOException - If an exception occurs.

writeAttributes

public void writeAttributes(IlvFeatureAttributeProperty attributes)
                     throws IOException
Writes the specified attributes as a new record in the file.

Parameters:
attributes - The attribute to be written.
Throws:
IOException - If an error occurs.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.