uk.me.parabola.mkgmap.general
Class LevelInfo

java.lang.Object
  extended by uk.me.parabola.mkgmap.general.LevelInfo
All Implemented Interfaces:
java.lang.Comparable<LevelInfo>

public class LevelInfo
extends java.lang.Object
implements java.lang.Comparable<LevelInfo>

Represents the mapping between the Garmin map levels and the built-in resolutions. The resolutions go from 1 to 24 and the levels start at 0 and are defined by the map maker. For each level you assign a resolution to it. The resolution for each level must be lower than that of the level below. As an example you might have the following level=resolution pairs: 0=24, 1=22, 2=20, 3=19. Note that level 0 is the most detailed level, whereas 24 is the most detailed resolution. The highest numbered level must be empty and cover the whole map.

Author:
Steve Ratcliffe

Field Summary
static java.lang.String DEFAULT_LEVELS
           
 
Constructor Summary
LevelInfo(int level, int bits)
           
 
Method Summary
 int compareTo(LevelInfo other)
          These things sort so that the highest level number is the lowest.
static LevelInfo[] createFromString(java.lang.String levelSpec)
          Convert a string into an array of LevelInfo structures.
 int getBits()
           
 int getLevel()
           
 boolean isTop()
           
 void setTop(boolean top)
           
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LEVELS

public static final java.lang.String DEFAULT_LEVELS
See Also:
Constant Field Values
Constructor Detail

LevelInfo

public LevelInfo(int level,
                 int bits)
Method Detail

createFromString

public static LevelInfo[] createFromString(java.lang.String levelSpec)
Convert a string into an array of LevelInfo structures.


toString

public java.lang.String toString()
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

getLevel

public int getLevel()

getBits

public int getBits()

isTop

public boolean isTop()

setTop

public void setTop(boolean top)

compareTo

public int compareTo(LevelInfo other)
These things sort so that the highest level number is the lowest. OK so its a bit wierd.

Specified by:
compareTo in interface java.lang.Comparable<LevelInfo>
Parameters:
other - The LevelInfo to compare to.
Returns:
Zero if they are equal and 1 if the object is greater and -1 otherwise.