uk.me.parabola.mkgmap.general
Class MapElement

java.lang.Object
  extended by uk.me.parabola.mkgmap.general.MapElement
Direct Known Subclasses:
MapLine, MapPoint

public abstract class MapElement
extends java.lang.Object

A map element is a point, line or shape that appears on the map. This class holds all the common routines that are shared across all elements.

Author:
Steve Ratcliffe.

Constructor Summary
protected MapElement()
           
protected MapElement(MapElement orig)
           
 
Method Summary
abstract  MapElement copy()
          Provide a copy of this MapElement without geometry.
 java.lang.String getCity()
           
 java.lang.String getCountry()
           
 ExtTypeAttributes getExtTypeAttributes()
           
 java.lang.String getHouseNumber()
           
 java.lang.String getIsIn()
           
abstract  Coord getLocation()
          Get the 'location' of the element.
 int getMaxResolution()
           
 int getMinResolution()
          Get the resolutions that an element should be displayed at.
 java.lang.String getName()
           
 java.lang.String getPhone()
           
 java.lang.String getRef()
           
 java.lang.String getRegion()
           
 java.lang.String getStreet()
           
 int getType()
          This is the type code that goes in the .img file so that the GPS device knows what to display.
 java.lang.String getZip()
           
 boolean hasExtendedType()
           
 boolean isSimilar(MapElement other)
           
 void setCity(java.lang.String city)
           
 void setCountry(java.lang.String country)
           
 void setExtTypeAttributes(ExtTypeAttributes eta)
           
 void setHouseNumber(java.lang.String houseNumber)
           
 void setIsIn(java.lang.String isIn)
           
 void setMaxResolution(int maxResolution)
           
 void setMinResolution(int minResolution)
           
 void setName(java.lang.String name)
           
 void setPhone(java.lang.String phone)
           
 void setRef(java.lang.String ref)
           
 void setRegion(java.lang.String region)
           
 void setStreet(java.lang.String street)
           
 void setType(int type)
           
 void setZip(java.lang.String zip)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapElement

protected MapElement()

MapElement

protected MapElement(MapElement orig)
Method Detail

copy

public abstract MapElement copy()
Provide a copy of this MapElement without geometry. This is used when filtering and clipping to create modified versions.

Returns:
the copy;

getName

public java.lang.String getName()

getRef

public java.lang.String getRef()

setName

public void setName(java.lang.String name)

setRef

public void setRef(java.lang.String ref)

getExtTypeAttributes

public ExtTypeAttributes getExtTypeAttributes()

setExtTypeAttributes

public void setExtTypeAttributes(ExtTypeAttributes eta)

getCity

public java.lang.String getCity()

setCity

public void setCity(java.lang.String city)

getZip

public java.lang.String getZip()

setZip

public void setZip(java.lang.String zip)

getCountry

public java.lang.String getCountry()

setCountry

public void setCountry(java.lang.String country)

getRegion

public java.lang.String getRegion()

setRegion

public void setRegion(java.lang.String region)

getStreet

public java.lang.String getStreet()

setStreet

public void setStreet(java.lang.String street)

getPhone

public java.lang.String getPhone()

setPhone

public void setPhone(java.lang.String phone)

getHouseNumber

public java.lang.String getHouseNumber()

setHouseNumber

public void setHouseNumber(java.lang.String houseNumber)

getIsIn

public java.lang.String getIsIn()

setIsIn

public void setIsIn(java.lang.String isIn)

getType

public int getType()
This is the type code that goes in the .img file so that the GPS device knows what to display.

Returns:
the type.

setType

public void setType(int type)

isSimilar

public boolean isSimilar(MapElement other)

hasExtendedType

public boolean hasExtendedType()

getLocation

public abstract Coord getLocation()
Get the 'location' of the element. This is the mid point of the bounding box for the element. For a point, this will be the coordinates of the point itself of course.

Returns:
Co-ordinate of the mid-point of the bounding box of the element.

getMinResolution

public int getMinResolution()
Get the resolutions that an element should be displayed at. It will return the minimum resolution at which this element should be displayed at.

Returns:
The lowest resolution at which the element will be visible.

setMinResolution

public void setMinResolution(int minResolution)

getMaxResolution

public int getMaxResolution()

setMaxResolution

public void setMaxResolution(int maxResolution)