uk.me.parabola.imgfmt.app.mdr
Class Mdr1
java.lang.Object
uk.me.parabola.imgfmt.app.mdr.ConfigBase
uk.me.parabola.imgfmt.app.mdr.MdrSection
uk.me.parabola.imgfmt.app.mdr.Mdr1
public class Mdr1
- extends MdrSection
The section MDR 1 contains a list of maps and for each map
an offset to a reverse index for that map.
The reverse index consists of a number of sections, that I call sub-sections
here. The sub-sections are all lists of record numbers in other sections
in the MDR that contain records belonging to more than one map.
Using the index you could extract records that belong to an individual map
from other MDR sections without having to go through them all and check
which map they belong to.
The subsections are as follows:
sub1 points into MDR 11 (POIs)
sub2 points into MDR 10 (POI types)
sub3 points into MDR 7 (street names)
sub4 points into MDR 5 (cities)
sub5 points into MDR 6
sub6 points into MDR 20
sub7 points into MDR 21
sub8 points into MDR 22
- Author:
- Steve Ratcliffe
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Mdr1
public Mdr1(MdrConfig config)
addMap
public void addMap(int mapNumber)
- Add a map. Create an MDR1 record for it and also allocate its reverse
index if this is not for a device.
- Parameters:
mapNumber
- The map index number.
writeSubSections
public void writeSubSections(ImgFileWriter writer)
writeSectData
public void writeSectData(ImgFileWriter writer)
- This is written right at the end after we know all the offsets in
the MDR 1 record.
- Specified by:
writeSectData
in class MdrSection
- Parameters:
writer
- The mdr 1 records are written out to this writer.
getItemSize
public int getItemSize()
- Description copied from class:
MdrSection
- The size of a record in the section. This is not a constant and
might vary on various factors, such as the file version, if we are
preparing for a device, the number of maps etc.
- Specified by:
getItemSize
in class MdrSection
- Returns:
- The size of a record in this section.
setStartPosition
public void setStartPosition(int sectionNumber)
setEndPosition
public void setEndPosition(int sectionNumber)
setPointerSize
public void setPointerSize(int sectionSize,
int recordSize)
addPointer
public void addPointer(int mapNumber,
int recordNumber)
getMapPointerSize
public int getMapPointerSize()