com.bbn.openmap.layer.vpf
Class DcwVariableLengthIndexFile

java.lang.Object
  extended by com.bbn.openmap.layer.vpf.DcwVariableLengthIndexFile

public class DcwVariableLengthIndexFile
extends java.lang.Object

Read in a VPF variable length index file, and allows access to individual records.


Constructor Summary
DcwVariableLengthIndexFile(BinaryFile inputstream, boolean msbfirst)
          Construct a new index file.
DcwVariableLengthIndexFile(java.lang.String filename, boolean msbfirst)
          Construct a new index file.
 
Method Summary
 void close()
          close the associated input file
 int getRecordCount()
          get the number of records in the index file
 int recordOffset(int recordNumber)
          get the offset byte offset of the record in the associated table file.
 int recordSize(int recordNumber)
          get the size of the record in the associated table file If recordNumber is greater than the number of records, this returns a record size of 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DcwVariableLengthIndexFile

public DcwVariableLengthIndexFile(java.lang.String filename,
                                  boolean msbfirst)
                           throws FormatException,
                                  java.io.IOException
Construct a new index file.

Parameters:
filename - the name of the file to read in.
msbfirst - the byte order of the file to be read.
Throws:
FormatException - some error was encountered in trying to read the file.
java.io.IOException

DcwVariableLengthIndexFile

public DcwVariableLengthIndexFile(BinaryFile inputstream,
                                  boolean msbfirst)
                           throws FormatException
Construct a new index file.

Parameters:
inputstream - BinaryBufferedFile handle.
msbfirst - the byte order of the file to be read.
Throws:
FormatException - some error was encountered in trying to read the file.
Method Detail

recordOffset

public int recordOffset(int recordNumber)
get the offset byte offset of the record in the associated table file. If recordNumber is greater than the number of records, this returns the offset of the end-of-file.

Parameters:
recordNumber - the record to retrieve the offset for

recordSize

public int recordSize(int recordNumber)
get the size of the record in the associated table file If recordNumber is greater than the number of records, this returns a record size of 0.

Parameters:
recordNumber - the record to retrieve the offset for

getRecordCount

public int getRecordCount()
get the number of records in the index file


close

public void close()
close the associated input file



Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details