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

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
              extended by uk.me.parabola.imgfmt.app.mdr.Mdr11

public class Mdr11
extends MdrMapSection

Holds all the POIs, including cities. Arranged alphabetically by the name.

Author:
Steve Ratcliffe

Constructor Summary
Mdr11(MdrConfig config)
           
 
Method Summary
 Mdr11Record addPoi(int mapIndex, Point point, java.lang.String name, int strOff)
           
 int getExtraValue()
          Return the value that is put in the header after the section start, len and recsize fields.
 int getItemSize()
          The size of a record in the section.
 int getNumberOfItems()
          The number of records in this section.
 int getNumberOfPois()
           
 int getPointerSize()
          Get the size of an integer that is sufficient to store a record number from this section.
 void writeSectData(ImgFileWriter writer)
          Write out the contents of this section.
 
Methods inherited from class uk.me.parabola.imgfmt.app.mdr.MdrMapSection
addIndexPointer, init, putCityIndex, putPoiIndex, putRegionIndex, setMapIndex
 
Methods inherited from class uk.me.parabola.imgfmt.app.mdr.MdrSection
getSizes, numberToPointerSize, putMapIndex, putN, putStringOffset, setSizes
 
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

Mdr11

public Mdr11(MdrConfig config)
Method Detail

addPoi

public Mdr11Record addPoi(int mapIndex,
                          Point point,
                          java.lang.String name,
                          int strOff)

writeSectData

public void writeSectData(ImgFileWriter writer)
Description copied from class: MdrSection
Write out the contents of this section.

Specified by:
writeSectData in class MdrSection
Parameters:
writer - Where to write it.

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.

getNumberOfItems

public int getNumberOfItems()
Description copied from class: MdrMapSection
The number of records in this section.

Specified by:
getNumberOfItems in class MdrMapSection
Returns:
The number of items in the section.

getNumberOfPois

public int getNumberOfPois()

getPointerSize

public int getPointerSize()
Get the size of an integer that is sufficient to store a record number from this section.

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

getExtraValue

public int getExtraValue()
Description copied from class: MdrMapSection
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.

Specified by:
getExtraValue in class MdrMapSection
Returns:
The correct value based on the contents of the section. Zero if nothing needs to be done.