uk.me.parabola.imgfmt.app.mdr
Class MdrMapSection

java.lang.Object
  extended by uk.me.parabola.imgfmt.app.mdr.ConfigBase
      extended by uk.me.parabola.imgfmt.app.mdr.MdrSection
          extended by uk.me.parabola.imgfmt.app.mdr.MdrMapSection
Direct Known Subclasses:
Mdr10, Mdr11, Mdr5, Mdr7

public abstract class MdrMapSection
extends MdrSection

Super class of all sections that contain items that belong to a particular map.

Author:
Steve Ratcliffe

Constructor Summary
MdrMapSection()
           
 
Method Summary
 void addIndexPointer(int mapNumber, int recordNumber)
          Add a pointer to the reverse index for this section.
abstract  int getExtraValue()
          Return the value that is put in the header after the section start, len and recsize fields.
abstract  int getNumberOfItems()
          The number of records in this section.
abstract  int getPointerSize()
          Get the size of an integer that is sufficient to store a record number from this section.
 void init(int sectionNumber)
           
protected  void putCityIndex(ImgFileWriter writer, int cityIndex, boolean isNew)
           
protected  void putPoiIndex(ImgFileWriter writer, int poiIndex, boolean isNew)
           
protected  void putRegionIndex(ImgFileWriter writer, int region)
           
 void setMapIndex(Mdr1 index)
           
 
Methods inherited from class uk.me.parabola.imgfmt.app.mdr.MdrSection
getItemSize, getSizes, numberToPointerSize, putMapIndex, putN, putStringOffset, setSizes, writeSectData
 
Methods inherited from class uk.me.parabola.imgfmt.app.mdr.ConfigBase
getConfig, isForDevice, setConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MdrMapSection

public MdrMapSection()
Method Detail

setMapIndex

public void setMapIndex(Mdr1 index)

init

public void init(int sectionNumber)

addIndexPointer

public void addIndexPointer(int mapNumber,
                            int recordNumber)
Add a pointer to the reverse index for this section.

Parameters:
recordNumber - A record number in this section, belonging to the given map.

getNumberOfItems

public abstract int getNumberOfItems()
The number of records in this section.

Returns:
The number of items in the section.

getPointerSize

public abstract int getPointerSize()
Get the size of an integer that is sufficient to store a record number from this section. If the pointer has a flag(s) then this must be taken into account too.

Returns:
A number between 1 and 4 giving the number of bytes required to store the largest record number in this section.

putCityIndex

protected void putCityIndex(ImgFileWriter writer,
                            int cityIndex,
                            boolean isNew)

putRegionIndex

protected void putRegionIndex(ImgFileWriter writer,
                              int region)

putPoiIndex

protected void putPoiIndex(ImgFileWriter writer,
                           int poiIndex,
                           boolean isNew)

getExtraValue

public abstract int getExtraValue()
Return the value that is put in the header after the section start, len and recsize fields. At least in some cases this field controls what fields and/or size exist in the section.

Returns:
The correct value based on the contents of the section. Zero if nothing needs to be done.