org.geotools.data.property
Class PropertyAttributeReader

java.lang.Object
  extended byorg.geotools.data.property.PropertyAttributeReader
All Implemented Interfaces:
AttributeReader

public class PropertyAttributeReader
extends java.lang.Object
implements AttributeReader

Simple AttributeReader that works against Java properties files.

This AttributeReader is part of the geotools2 DataStore tutorial, and should be considered a Toy.

The content of this file should start with a the property "_" with the value being the typeSpec describing the featureType. Thereafter each line will should have a 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
 

Author:
jgarnett

Constructor Summary
PropertyAttributeReader(java.io.File file)
          Creates a new PropertyAttributeReader object.
 
Method Summary
 void close()
          DOCUMENT ME!
 int getAttributeCount()
          DOCUMENT ME!
 AttributeType getAttributeType(int index)
          DOCUMENT ME!
 java.lang.String getFeatureID()
          DOCUMENT ME!
 boolean hasNext()
          DOCUMENT ME!
 void next()
          DOCUMENT ME!
 java.lang.Object read(int index)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyAttributeReader

public PropertyAttributeReader(java.io.File file)
                        throws java.io.IOException
Creates a new PropertyAttributeReader object.

Parameters:
file - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!
Method Detail

getAttributeCount

public int getAttributeCount()
DOCUMENT ME!

Specified by:
getAttributeCount in interface AttributeReader
Returns:
DOCUMENT ME!

getAttributeType

public AttributeType getAttributeType(int index)
                               throws java.lang.ArrayIndexOutOfBoundsException
DOCUMENT ME!

Specified by:
getAttributeType in interface AttributeReader
Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ArrayIndexOutOfBoundsException - DOCUMENT ME!

close

public void close()
           throws java.io.IOException
DOCUMENT ME!

Specified by:
close in interface AttributeReader
Throws:
java.io.IOException - DOCUMENT ME!

hasNext

public boolean hasNext()
                throws java.io.IOException
DOCUMENT ME!

Specified by:
hasNext in interface AttributeReader
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

next

public void next()
          throws java.io.IOException
DOCUMENT ME!

Specified by:
next in interface AttributeReader
Throws:
java.io.IOException - DOCUMENT ME!
java.util.NoSuchElementException - DOCUMENT ME!

getFeatureID

public java.lang.String getFeatureID()
DOCUMENT ME!

Returns:
DOCUMENT ME!

read

public java.lang.Object read(int index)
                      throws java.io.IOException,
                             java.lang.ArrayIndexOutOfBoundsException
DOCUMENT ME!

Specified by:
read in interface AttributeReader
Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!
java.lang.ArrayIndexOutOfBoundsException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!


Copyright © GeoTools. All Rights Reserved.