org.rosuda.ibase
Class MapSegmentEntry

java.lang.Object
  extended by org.rosuda.ibase.MapSegmentEntry

public class MapSegmentEntry
extends java.lang.Object

MapSegmentEntry encapsulates individual polygons in a map segment. They are specified by the coordinates of the points along the path. Each map segment may consist of multiple segment entries.


Field Summary
 boolean hasBorder
          flag specifying whether this polygon has a border
 boolean isLake
          flag specifying whether this polygon is a "lake"
 double maxX
          extents of the polygon (bounding box)
 double maxY
          extents of the polygon (bounding box)
 double minX
          extents of the polygon (bounding box)
 double minY
          extents of the polygon (bounding box)
 double[] xp
          coordinates of the polygon points
 double[] yp
          coordinates of the polygon points
 
Constructor Summary
MapSegmentEntry()
          create a new, empty map segment entry.
MapSegmentEntry(double[] xpt, double[] ypt, boolean lake, boolean border)
          designated constructor of a map segment entry.
MapSegmentEntry(double[] xpt, double[] ypt, int offset, int length, boolean lake, boolean border)
          constructor of a map segment entry, allowing the use of a part of an array. length is shrunk to reflect xpt.length where necessary and where relevant xpt.length>ypt.length causes ypt to be padded with zeros.
 
Method Summary
 void fixBoundingBox()
          re-calculate bounding box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xp

public double[] xp
coordinates of the polygon points


yp

public double[] yp
coordinates of the polygon points


isLake

public boolean isLake
flag specifying whether this polygon is a "lake"


hasBorder

public boolean hasBorder
flag specifying whether this polygon has a border


minX

public double minX
extents of the polygon (bounding box)


maxX

public double maxX
extents of the polygon (bounding box)


minY

public double minY
extents of the polygon (bounding box)


maxY

public double maxY
extents of the polygon (bounding box)

Constructor Detail

MapSegmentEntry

public MapSegmentEntry()
create a new, empty map segment entry.


MapSegmentEntry

public MapSegmentEntry(double[] xpt,
                       double[] ypt,
                       boolean lake,
                       boolean border)
designated constructor of a map segment entry. Note that xpt.length specifies the number of points used. If xpt.length>ypt.length then ypt is padded with zeros.

Parameters:
xpt - x-coordinates of the points (length of this array specifies the number of points of this entry)
ypt - y-coordinates of the points (padded with 0 if too short)
lake - flag specifying whether this polygon is a lake
border - border flag of this segment entry

MapSegmentEntry

public MapSegmentEntry(double[] xpt,
                       double[] ypt,
                       int offset,
                       int length,
                       boolean lake,
                       boolean border)
constructor of a map segment entry, allowing the use of a part of an array. length is shrunk to reflect xpt.length where necessary and where relevant xpt.length>ypt.length causes ypt to be padded with zeros.

Parameters:
xpt - x-coordinates of the points
ypt - y-coordinates of the points (padded with 0 if too short)
offset - offset at which to start
length - number of entries to use (will be reduced if offset+length is larger that the xpt array)
lake - flag specifying whether this polygon is a lake
border - border flag of this segment entry
Method Detail

fixBoundingBox

public void fixBoundingBox()
re-calculate bounding box. Call this method after modifying the xp or yp arrays.