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

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

public class Polyline
extends MapObject

Represents a multi-segment line. Eg for a road. As with all map objects it can only exist as part of a subdivision. Writing these out is particularly tricky as deltas between points are packed into the smallest number of bits possible. I am not trying to make the smallest map, so it will not be totally optimum.

Author:
Steve Ratcliffe

Constructor Summary
Polyline(Subdivision div)
           
 
Method Summary
 void addCoord(Coord co)
           
 boolean isLastSegment()
           
 boolean isRoad()
           
 boolean roadHasInternalNodes()
           
 void setDirection(boolean direction)
           
 void setLastSegment(boolean last)
           
 void setRoadDef(RoadDef rd)
           
 boolean sharesNodeWith(Polyline other)
           
 void write(ImgFileWriter file)
          Format and write the contents of the object to the given file.
 void write(java.io.OutputStream stream)
           
 
Methods inherited from class uk.me.parabola.imgfmt.app.trergn.MapObject
addRefLabel, getDeltaLong, getExtTypeExtraBytes, getLabel, getNumber, getRefLabels, getSubdiv, getType, hasExtendedType, hasExtendedType, setDeltaLat, setDeltaLong, setExtTypeAttributes, setLabel, setLatitude, setLongitude, setNumber, setSubdiv, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Polyline

public Polyline(Subdivision div)
Method Detail

write

public void write(ImgFileWriter file)
Format and write the contents of the object to the given file.

Specified by:
write in class MapObject
Parameters:
file - A reference to the file that should be written to.

write

public void write(java.io.OutputStream stream)
           throws java.io.IOException
Specified by:
write in class MapObject
Throws:
java.io.IOException

addCoord

public void addCoord(Coord co)

setDirection

public void setDirection(boolean direction)

isRoad

public boolean isRoad()

roadHasInternalNodes

public boolean roadHasInternalNodes()

setLastSegment

public void setLastSegment(boolean last)

isLastSegment

public boolean isLastSegment()

setRoadDef

public void setRoadDef(RoadDef rd)

sharesNodeWith

public boolean sharesNodeWith(Polyline other)