org.geotools.data.shapefile.indexed
Class IndexedShapefileAttributeReader

Object
  extended by AbstractAttributeIO
      extended by ShapefileAttributeReader
          extended by IndexedShapefileAttributeReader
All Implemented Interfaces:
AttributeReader, RecordNumberTracker

public class IndexedShapefileAttributeReader
extends ShapefileAttributeReader
implements RecordNumberTracker

An AttributeReader implementation for shape. Pretty straightforward.
The default geometry is at position 0, and all dbf columns follow.
The dbf file may not be necessary, if not, just pass null as the DbaseFileReader


Field Summary
protected  Iterator<Data> goodRecs
           
 
Fields inherited from class ShapefileAttributeReader
dbf, record, row, shp
 
Fields inherited from class AbstractAttributeIO
metaData
 
Constructor Summary
IndexedShapefileAttributeReader(AttributeDescriptor[] atts, ShapefileReader shp, IndexedDbaseFileReader dbf, CloseableCollection<Data> goodRecs)
          Create the shape reader
IndexedShapefileAttributeReader(List<AttributeDescriptor> attributes, ShapefileReader shp, IndexedDbaseFileReader dbf, CloseableCollection<Data> goodRecs)
           
 
Method Summary
 void close()
          Release any resources associated with this reader
 int getRecordNumber()
           
 boolean hasNext()
          Does another set of attributes exist in this reader?
 void next()
          Advance the reader to the next set of attributes.
 
Methods inherited from class ShapefileAttributeReader
read
 
Methods inherited from class AbstractAttributeIO
copy, getAttributeCount, getAttributeType
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface AttributeReader
getAttributeCount, getAttributeType
 

Field Detail

goodRecs

protected Iterator<Data> goodRecs
Constructor Detail

IndexedShapefileAttributeReader

public IndexedShapefileAttributeReader(List<AttributeDescriptor> attributes,
                                       ShapefileReader shp,
                                       IndexedDbaseFileReader dbf,
                                       CloseableCollection<Data> goodRecs)

IndexedShapefileAttributeReader

public IndexedShapefileAttributeReader(AttributeDescriptor[] atts,
                                       ShapefileReader shp,
                                       IndexedDbaseFileReader dbf,
                                       CloseableCollection<Data> goodRecs)
Create the shape reader

Parameters:
atts - - the attributes that we are going to read.
shp - - the shape reader, required
dbf - - the dbf file reader. May be null, in this case no attributes will be read from the dbf file
goodRecs - Collection of good indexes that match the query.
Method Detail

close

public void close()
           throws IOException
Description copied from interface: AttributeReader
Release any resources associated with this reader

Specified by:
close in interface AttributeReader
Specified by:
close in interface RecordNumberTracker
Overrides:
close in class ShapefileAttributeReader
Throws:
IOException

hasNext

public boolean hasNext()
                throws IOException
Description copied from interface: AttributeReader
Does another set of attributes exist in this reader?

Specified by:
hasNext in interface AttributeReader
Overrides:
hasNext in class ShapefileAttributeReader
Returns:
true if additional content exists for AttributeReader
Throws:
IOException

next

public void next()
          throws IOException
Description copied from interface: AttributeReader
Advance the reader to the next set of attributes.

Specified by:
next in interface AttributeReader
Overrides:
next in class ShapefileAttributeReader
Throws:
IOException

getRecordNumber

public int getRecordNumber()
Specified by:
getRecordNumber in interface RecordNumberTracker


Copyright © 1996-2009 Geotools. All Rights Reserved.