org.geotools.data.shapefile.indexed
Class IndexedFidWriter

java.lang.Object
  extended byorg.geotools.data.shapefile.indexed.IndexedFidWriter

public class IndexedFidWriter
extends java.lang.Object

The Writer writes out the fid and record number of features to the fid index file.

Author:
Jesse

Field Summary
static int HEADER_SIZE
           
static int RECORD_SIZE
           
 
Constructor Summary
IndexedFidWriter(java.nio.channels.FileChannel writeChannel, IndexedFidReader reader2)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 boolean isClosed()
           
 long next()
           
 void remove()
          Increments the fidIndex by 1.
 void write()
          Writes the current fidIndex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_SIZE

public static final int HEADER_SIZE
See Also:
Constant Field Values

RECORD_SIZE

public static final int RECORD_SIZE
See Also:
Constant Field Values
Constructor Detail

IndexedFidWriter

public IndexedFidWriter(java.nio.channels.FileChannel writeChannel,
                        IndexedFidReader reader2)
                 throws java.io.IOException
Method Detail

hasNext

public boolean hasNext()
                throws java.io.IOException
Throws:
java.io.IOException

next

public long next()
          throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

remove

public void remove()
            throws java.io.IOException
Increments the fidIndex by 1. Indicates that a feature was removed from the location. This is intended to ensure that FIDs stay constant over time. Consider the following case of 5 features. feature 1 has fid typename.0 feature 2 has fid typename.1 feature 3 has fid typename.2 feature 4 has fid typename.3 feature 5 has fid typename.4 when feature 3 is removed/deleted the following usage of the write should take place: next(); (move to feature 1) next(); (move to feature 2) next(); (move to feature 3) remove();(delete feature 3) next(); (move to feature 4) // optional write(); (write feature 4) next(); (move to feature 5) write(); (write(feature 5)

Throws:
java.io.IOException

write

public void write()
           throws java.io.IOException
Writes the current fidIndex. Writes to the same place in the file each time. Only next() moves forward in the file.

Throws:
java.io.IOException
See Also:
next(), remove()

isClosed

public boolean isClosed()


Copyright © GeoTools. All Rights Reserved.