Package org.meteoinfo.data.mapdata
Class AttributeTable
- java.lang.Object
-
- org.meteoinfo.data.mapdata.AttributeTable
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class AttributeTable extends java.lang.Object implements java.lang.CloneableAttribute table of shape file
-
-
Constructor Summary
Constructors Constructor Description AttributeTable()ConstructorAttributeTable(java.lang.String filename)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clonevoidfill(int numRows)This populates the Table with data from the file.java.lang.StringgetEncoding()Get encoding stringjava.io.FilegetFile()Get fileintgetNumRecords()Get record numberDataTablegetTable()Get data tablevoidopen(java.lang.String filename)Reads all the information from the file, including the vector shapes and the database component.voidopenDBF(java.lang.String fileName)Reads all the information from the dBase file, including the vector shapes and the database component.voidsave()Save the filevoidsave(java.lang.String fileName)Save the filevoidsaveAs(java.lang.String fileName, boolean overwrite)Save this table to the specified file namevoidsetEncoding(java.lang.String value)Set encoding stringvoidsetTable(DataTable table)Set data tablevoidupdateDataTable()Update data table - convert DataColumn to FieldvoidwriteHeader(EndianDataOutputStream writer)Write the header data to the DBF filevoidwriteTable()This appends the content of one datarow to a DBF file
-
-
-
Constructor Detail
-
AttributeTable
public AttributeTable()
Constructor
-
AttributeTable
public AttributeTable(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionConstructor- Parameters:
filename- The file name- Throws:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
-
Method Detail
-
getFile
public java.io.File getFile()
Get file- Returns:
- File
-
getNumRecords
public int getNumRecords()
Get record number- Returns:
- Record number
-
getTable
public DataTable getTable()
Get data table- Returns:
- The data table
-
setTable
public void setTable(DataTable table)
Set data table- Parameters:
table- The data table
-
getEncoding
public java.lang.String getEncoding()
Get encoding string- Returns:
- Encoding string
-
setEncoding
public void setEncoding(java.lang.String value)
Set encoding string- Parameters:
value- Encoding string
-
updateDataTable
public void updateDataTable()
Update data table - convert DataColumn to Field
-
open
public void open(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionReads all the information from the file, including the vector shapes and the database component.- Parameters:
filename- The file name- Throws:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
openDBF
public void openDBF(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionReads all the information from the dBase file, including the vector shapes and the database component.- Parameters:
fileName- The dBase file name- Throws:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
fill
public void fill(int numRows) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ExceptionThis populates the Table with data from the file.- Parameters:
numRows- In the event that the dbf file is not found, this indicates how many blank rows should exist in the attribute Table.- Throws:
java.io.FileNotFoundExceptionjava.io.IOExceptionjava.lang.Exception
-
save
public void save()
Save the file
-
save
public void save(java.lang.String fileName)
Save the file- Parameters:
fileName- File name
-
saveAs
public void saveAs(java.lang.String fileName, boolean overwrite)Save this table to the specified file name- Parameters:
fileName- The file name to be savedoverwrite- If over write the file if it exists
-
writeHeader
public void writeHeader(EndianDataOutputStream writer) throws java.io.IOException
Write the header data to the DBF file- Parameters:
writer- The writer stream- Throws:
java.io.IOException- IO exception
-
writeTable
public void writeTable() throws java.io.IOExceptionThis appends the content of one datarow to a DBF file- Throws:
java.io.IOException
-
clone
public java.lang.Object clone()
Clone- Overrides:
clonein classjava.lang.Object- Returns:
- AttributeTable object
-
-