|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectPropertyAttributeWriter
public class PropertyAttributeWriter
Simple AttributeWriter that produces Java properties files.
This AttributeWriter is part of the geotools2 DataStore tutorial, and should be considered a Toy.
The content produced witll start with the property "_" with the value being the typeSpec describing the featureType. Thereafter each line will represent a Features with FeatureID as the property and the attribtues as the value separated by | characters.
_=id:Integer|name:String|geom:Geometry
fid1=1|Jody|well known text
fid2=2|Brent|well known text
fid3=3|Dave|well known text
modules/plugin/property (gt-property.jar)
Constructor Summary | |
---|---|
PropertyAttributeWriter(File file,
SimpleFeatureType featureType)
|
Method Summary | |
---|---|
void |
close()
|
void |
echoLine(String line)
|
int |
getAttributeCount()
The number of attributes this reader can read, i.e the length of a row. |
AttributeDescriptor |
getAttributeType(int index)
Retrieve the AttributeType at the given index. |
boolean |
hasNext()
Query whether there are other rows in the attribute writer. |
void |
next()
Advance the AttributeWriter, all calls to write will correspond to the same set of attributes until next is called again. |
void |
write(int position,
Object attribute)
Write the given attribute value at the position indicated. |
void |
writeFeatureID(String fid)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyAttributeWriter(File file, SimpleFeatureType featureType) throws IOException
IOException
Method Detail |
---|
public int getAttributeCount()
AttributeWriter
getAttributeCount
in interface AttributeWriter
public AttributeDescriptor getAttributeType(int index) throws ArrayIndexOutOfBoundsException
AttributeWriter
getAttributeType
in interface AttributeWriter
ArrayIndexOutOfBoundsException
public boolean hasNext() throws IOException
AttributeWriter
hasNext
in interface AttributeWriter
IOException
FeatureWriter.hasNext()
public void next() throws IOException
AttributeWriter
next
in interface AttributeWriter
IOException
public void echoLine(String line) throws IOException
IOException
public void writeFeatureID(String fid) throws IOException
IOException
public void write(int position, Object attribute) throws IOException
AttributeWriter
write
in interface AttributeWriter
IOException
public void close() throws IOException
close
in interface AttributeWriter
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |