|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.maps.format.shapefile.IlvDBFReader
public class IlvDBFReader
This class can be used to read Shapefiles with the
.dbf extension. The .dbf files contain
the attributes of the map objects.
This reader can be used as
an iterator on a .dbf file. It can also be used
to directly access the records in the file (or more precisely their index)
if it was created with the constructor that takes a file name as argument.
IlvShapeFileReader| Constructor Summary | |
|---|---|
IlvDBFReader(DataInput dataInput)
Creates an instance of IlvDBFReader
from a data input. |
|
IlvDBFReader(String fileName)
Creates an instance of IlvDBFReader
for the specified file name. |
|
IlvDBFReader(URL url)
Creates an instance of IlvDBFReader for the specified URL. |
|
| Method Summary | |
|---|---|
void |
dispose()
Releases the resources allocated to the reader. |
void |
finalize()
Is called by the Java Garbage Collector to release the resources allocated to the reader. |
IlvAttributeInfoProperty |
getAttributeInfo()
Returns the types and names of the fields contained in the .dbf file. |
int |
getAttributeSize(int index)
Return the size of the attribute specified by the index. |
int |
getCurrentIndex()
Returns the index of the next field that will be read. |
IlvFeatureAttributeProperty |
getNextRecord()
Reads the next record in the .dbf file. |
int |
getRecordCount()
Returns the number of records contained in the .dbf file. |
String |
getStringEncoding()
Returns the character encoding used when reading attributes. |
boolean |
isInterningStringAttributes()
Returns true if the String attributes that are read are
interned. |
boolean |
isReadingAttribute(int index)
Returns true if the specified attribute is read. |
boolean |
isReadingAttribute(String name)
Returns true if the specified attribute is read. |
boolean |
isTrimmingStringAttributes()
Returns true if the String attributes that are read are
trimmed, that is, leading and trailing spaces are removed. |
IlvFeatureAttributeProperty |
readRecord(int index)
Reads the record corresponding to the specified index (see restrictions below). |
void |
setInterningStringAttributes(boolean set)
Specifies whether the String attributes that are read are interned. |
void |
setReadingAttribute(int index,
boolean set)
Tells the reader whether to read the attribute whose index is specified. |
void |
setReadingAttribute(String name,
boolean set)
Tells the reader whether to read the attribute whose name is specified. |
void |
setStringEncoding(String encoding)
Specifies which character encoding is used when reading attributes. |
void |
setTrimmingStringAttributes(boolean set)
Specifies whether the String attributes that are read are trimmed, that is, leading and trailing spaces are removed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlvDBFReader(String fileName)
throws IOException
IlvDBFReader
for the specified file name.
fileName - The name of the DBF file
IOException - if the file cannot be opened.
public IlvDBFReader(URL url)
throws IOException
IlvDBFReader for the specified URL.
url - The url of the DBF file (with the .dbf extension)
IOException - if an error occurs while opening the file.
public IlvDBFReader(DataInput dataInput)
throws IOException
IlvDBFReader
from a data input.
dataInput - the data input.
IOException - if the file cannot be opened.| Method Detail |
|---|
public void setTrimmingStringAttributes(boolean set)
set - If true, String attributes are trimmed.public boolean isTrimmingStringAttributes()
true if the String attributes that are read are
trimmed, that is, leading and trailing spaces are removed.
The default is false.
public void setInterningStringAttributes(boolean set)
isInterningStringAttributes(),
String.intern()public boolean isInterningStringAttributes()
true if the String attributes that are read are
interned. The default is false.
setInterningStringAttributes(boolean)public void setStringEncoding(String encoding)
encoding - The String encoding or null to read the
attributes using the default encoding of the platform.public String getStringEncoding()
null if
using the default encoding of the platform.
public void setReadingAttribute(String name,
boolean set)
name - The name of the attribute.set - If true, the specified attribute is read.public boolean isReadingAttribute(String name)
true if the specified attribute is read.
name - The name of the attribute.
public void setReadingAttribute(int index,
boolean set)
index - The index of the attribute.set - If true, the specified attribute is read.public boolean isReadingAttribute(int index)
true if the specified attribute is read.
index - The index of the attribute.public final int getRecordCount()
.dbf file.
public final IlvAttributeInfoProperty getAttributeInfo()
.dbf file.
Each record has the same fields.
public int getAttributeSize(int index)
index - The index of the attribute.public int getCurrentIndex()
public IlvFeatureAttributeProperty getNextRecord()
throws IOException
.dbf file.
The returned attribute value is volatile and might be modified
when the getNextRecord method is called again.
IOException - if the end of the file is reached or
if an IO exception is thrown.getCurrentIndex()
public IlvFeatureAttributeProperty readRecord(int index)
throws IOException
IlvShapeFileReader.
IOException - if the end of the file is reached or
if an IO exception is thrown.public void dispose()
public void finalize()
dispose function
was not called, it releases the resources used by the reader.
finalize in class Objectdispose()
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||