com.partnersoft.v3x.apps.MapBrowser.locate
Class PointDatafile

java.lang.Object
  extended by com.partnersoft.v3x.io.formats.ObjectDatafile
      extended by com.partnersoft.v3x.apps.MapBrowser.locate.PointDatafile

public class PointDatafile
extends ObjectDatafile

A datafile for named X, Y points.


Constructor Summary
PointDatafile(java.lang.String filename)
           
 
Method Summary
protected  int compareImp(java.io.RandomAccessFile filet, long seekA, long seekB)
          Subclasses may override this to compare two records directly.
protected  int compareImp(java.io.RandomAccessFile filet, java.lang.Object key)
          Subclasses may override this to compare the seeked-to record to a key.
protected  java.lang.Object readKeyImp(java.io.RandomAccessFile filet)
          Subclasses may override this to read the key for a record.
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.
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, findClosest, getFile, getHeaderSize, getRecordSize, getSize, openRead, openWrite, readHeader, readHeaderImp, readKey, readRecord, readRecord, search, setHeaderSize, setRecordSize, sort, writeHeader, writeHeaderImp, writeRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointDatafile

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

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)
                                  throws java.io.IOException
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
Throws:
java.io.IOException

readRecordImp

protected void readRecordImp(java.lang.Object recycleMe,
                             java.io.RandomAccessFile filet)
                      throws java.io.IOException
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
Throws:
java.io.IOException

readKeyImp

protected java.lang.Object readKeyImp(java.io.RandomAccessFile filet)
                               throws java.io.IOException
Description copied from class: ObjectDatafile
Subclasses may override this to read the key for a record. Again, you can assume the file is at the correct location. Default is to simply read the whole record.

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

compareImp

protected int compareImp(java.io.RandomAccessFile filet,
                         long seekA,
                         long seekB)
                  throws java.io.IOException
Description copied from class: ObjectDatafile
Subclasses may override this to compare two records directly. This must be overridden if you plan on using the sorting or searching features. Pretty standard: -1 means a is less than b; 0 means they are equal; 1 means b is less than a. The parameters include the seek positions for both A and B. Default returns 0.

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

compareImp

protected int compareImp(java.io.RandomAccessFile filet,
                         java.lang.Object key)
                  throws java.io.IOException
Description copied from class: ObjectDatafile
Subclasses may override this to compare the seeked-to record to a key. This must be overridden if you plan on using the sorting or searching features. Pretty standard: -1 means a is less than b; 0 means they are equal; 1 means b is less than a. Default is 0.

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