Package org.geotools.data.shapefile.fid
Class IndexedFidReader
Object
IndexedFidReader
- All Implemented Interfaces:
AutoCloseable,FIDReader,FileReader
This object reads from a file the fid of a feature in a shapefile.
- Author:
- Jesse
-
Constructor Summary
ConstructorsConstructorDescriptionIndexedFidReader(ShpFiles shpFiles) IndexedFidReader(ShpFiles shpFiles, ReadableByteChannel in) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release any resources associated with this readerintReturns the record number of the feature in the shx or shp that is identified by the the last fid returned by next().longReturns the offset to the location in the SHX file that the fid identifies.longgetCount()Returns the number of Fid Entries in the file.longReturns the index that is appended to the typename to construct the fid.intReturns the number of features that have been removed since the fid index was regenerated.voidgoTo(long recno) booleanhasNext()Returns whether another fid exists for this reader.id()An id for the reader.next()Gets the next FID from the Reader.
-
Constructor Details
-
IndexedFidReader
- Throws:
IOException
-
IndexedFidReader
- Throws:
IOException
-
-
Method Details
-
getCount
public long getCount()Returns the number of Fid Entries in the file.- Returns:
- Returns the number of Fid Entries in the file.
-
getRemoves
public int getRemoves()Returns the number of features that have been removed since the fid index was regenerated.- Returns:
- Returns the number of features that have been removed since the fid index was regenerated.
-
findFid
Returns the offset to the location in the SHX file that the fid identifies. This search take logN time.- Parameters:
fid- the fid to find.- Returns:
- Returns the record number of the record in the SHX file that the fid identifies. Will return -1 if the fid was not found.
- Throws:
IOException
-
goTo
- Throws:
IOException
-
close
Description copied from interface:FIDReaderRelease any resources associated with this reader- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceFIDReader- Throws:
IOException
-
hasNext
Description copied from interface:FIDReaderReturns whether another fid exists for this reader.- Specified by:
hasNextin interfaceFIDReader- Returns:
trueif more content exists- Throws:
IOException
-
next
Description copied from interface:FIDReaderGets the next FID from the Reader.- Specified by:
nextin interfaceFIDReader- Returns:
- Next featureID
- Throws:
IOException
-
currentSHXIndex
public int currentSHXIndex()Returns the record number of the feature in the shx or shp that is identified by the the last fid returned by next().- Returns:
- Returns the record number of the feature in the shx or shp that is identified by the the last fid returned by next().
-
getCurrentFIDIndex
public long getCurrentFIDIndex()Returns the index that is appended to the typename to construct the fid.- Returns:
- the index that is appended to the typename to construct the fid.
-
id
Description copied from interface:FileReaderAn id for the reader. This is only used for debugging.- Specified by:
idin interfaceFileReader- Returns:
- id for the reader.
-