com.partnersoft.v3x.graphics.codec.shapeFile
Class SHXFile

java.lang.Object
  extended by com.partnersoft.v3x.io.formats.ObjectDatafile
      extended by com.partnersoft.v3x.graphics.codec.shapeFile.SHXFile

public class SHXFile
extends ObjectDatafile

a shx file. simply an index into the shp file


Constructor Summary
SHXFile(java.lang.String filename)
           
 
Method Summary
 DoubleRectangle getExtents()
           
 java.io.RandomAccessFile getFile()
          If you just have to bang on the file, use this.
 int getNumberOfRecords()
           
 int getRecordType()
           
protected  void readRecordImp(java.lang.Object recycleMe, java.io.RandomAccessFile filet)
          Subclasses must override this to read an object from the fixed-length format, given an object to put the results into.
protected  java.lang.Object readRecordImp(java.io.RandomAccessFile filet)
          Subclasses must override this to read an object from the fixed-length format.
 void setExtents(DoubleRectangle dr)
           
 void setNumberOfRecords(int newNumber)
           
 void setRecordType(int newType)
           
 void updateHeader(int newNumberOfRecords, DoubleRectangle extents, java.io.RandomAccessFile filet)
          this will update the record length and extents
 void writeHeader()
           
protected  void writeHeaderImp(java.lang.Object header, java.io.RandomAccessFile filet)
          Override this if you want it to do anything.
protected  void writeRecordImp(java.lang.Object source, java.io.RandomAccessFile filet)
          Subclasses must override this to write out the object in the desired form.
 
Methods inherited from class com.partnersoft.v3x.io.formats.ObjectDatafile
appendRecord, clear, close, compare, compare, compareImp, compareImp, findClosest, getHeaderSize, getRecordSize, getSize, openRead, openWrite, readHeader, readHeaderImp, readKey, readKeyImp, readRecord, readRecord, search, setHeaderSize, setRecordSize, sort, writeHeader, writeRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHXFile

public SHXFile(java.lang.String filename)
Method Detail

getFile

public java.io.RandomAccessFile getFile()
Description copied from class: ObjectDatafile
If you just have to bang on the file, use this. Be careful, dammit!

Overrides:
getFile in class ObjectDatafile

writeRecordImp

protected void writeRecordImp(java.lang.Object source,
                              java.io.RandomAccessFile filet)
                       throws java.io.IOException
Description copied from class: ObjectDatafile
Subclasses must override this to write out the object in the desired form. The RandomAccessFile is advanced to the correct spot; just write away.

Specified by:
writeRecordImp in class ObjectDatafile
Throws:
java.io.IOException

readRecordImp

protected java.lang.Object readRecordImp(java.io.RandomAccessFile filet)
Description copied from class: ObjectDatafile
Subclasses must override this to read an object from the fixed-length format. The RandomAccessFile is advanced to the correct spot; just read away.

Specified by:
readRecordImp in class ObjectDatafile

readRecordImp

protected void readRecordImp(java.lang.Object recycleMe,
                             java.io.RandomAccessFile filet)
Description copied from class: ObjectDatafile
Subclasses must override this to read an object from the fixed-length format, given an object to put the results into. Quite often, for speed, you don't want to create objects, but reuse them instead. This allows you to do that.

The RandomAccessFile is advanced to the correct spot; just read away.

Specified by:
readRecordImp in class ObjectDatafile

writeHeader

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

writeHeaderImp

protected void writeHeaderImp(java.lang.Object header,
                              java.io.RandomAccessFile filet)
                       throws java.io.IOException
Description copied from class: ObjectDatafile
Override this if you want it to do anything. Be sure to set your header size!

Overrides:
writeHeaderImp in class ObjectDatafile
Throws:
java.io.IOException

updateHeader

public void updateHeader(int newNumberOfRecords,
                         DoubleRectangle extents,
                         java.io.RandomAccessFile filet)
this will update the record length and extents


setExtents

public void setExtents(DoubleRectangle dr)

getExtents

public DoubleRectangle getExtents()

setNumberOfRecords

public void setNumberOfRecords(int newNumber)

getNumberOfRecords

public int getNumberOfRecords()

setRecordType

public void setRecordType(int newType)

getRecordType

public int getRecordType()