uk.me.parabola.imgfmt.app.trergn
Class MapObject

java.lang.Object
  extended by uk.me.parabola.imgfmt.app.trergn.MapObject
Direct Known Subclasses:
Point, Polyline

public abstract class MapObject
extends java.lang.Object

An object that appears in a map. One of point, polyline, polygon or indexed point. All objects appear in a subdivision and are relative to it. You cannot know where the object is or its size without knowing the subdivision it is in.

Author:
Steve Ratcliffe

Constructor Summary
MapObject()
           
 
Method Summary
 void addRefLabel(Label refLabel)
           
protected  int getDeltaLong()
           
protected  byte[] getExtTypeExtraBytes()
           
 Label getLabel()
           
 int getNumber()
           
 java.util.List<Label> getRefLabels()
           
 Subdivision getSubdiv()
           
 int getType()
           
 boolean hasExtendedType()
           
static boolean hasExtendedType(int type)
           
protected  void setDeltaLat(int deltaLat)
           
protected  void setDeltaLong(int deltaLong)
           
 void setExtTypeAttributes(ExtTypeAttributes eta)
           
 void setLabel(Label label)
           
 void setLatitude(int lat)
          Set an ordinary unshifted latitude.
 void setLongitude(int lon)
          Set an ordinary unshifted longitude.
 void setNumber(int number)
           
protected  void setSubdiv(Subdivision subdiv)
           
 void setType(int type)
           
 java.lang.String toString()
           
abstract  void write(ImgFileWriter file)
          Write this object to the given file.
abstract  void write(java.io.OutputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapObject

public MapObject()
Method Detail

write

public abstract void write(ImgFileWriter file)
Write this object to the given file.

Parameters:
file - The file to write to. It is usually the RGN file.

write

public abstract void write(java.io.OutputStream stream)
                    throws java.io.IOException
Throws:
java.io.IOException

getDeltaLong

protected int getDeltaLong()

setLabel

public void setLabel(Label label)

addRefLabel

public void addRefLabel(Label refLabel)

getType

public int getType()

setType

public void setType(int type)

hasExtendedType

public boolean hasExtendedType()

hasExtendedType

public static boolean hasExtendedType(int type)

setLatitude

public void setLatitude(int lat)
Set an ordinary unshifted latitude. It will be calculated relative to the subdivision.

Parameters:
lat - The original latitude.

setLongitude

public void setLongitude(int lon)
Set an ordinary unshifted longitude. It will be calculated relative to the subdivision.

Parameters:
lon - The original longitude.

setDeltaLat

protected void setDeltaLat(int deltaLat)

setDeltaLong

protected void setDeltaLong(int deltaLong)

getSubdiv

public Subdivision getSubdiv()

setSubdiv

protected void setSubdiv(Subdivision subdiv)

getLabel

public Label getLabel()

getRefLabels

public java.util.List<Label> getRefLabels()

getExtTypeExtraBytes

protected byte[] getExtTypeExtraBytes()

setExtTypeAttributes

public void setExtTypeAttributes(ExtTypeAttributes eta)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNumber

public int getNumber()

setNumber

public void setNumber(int number)