shp_renderer.data
Class SHPData

java.lang.Object
  extended by shp_renderer.data.SHPData

public class SHPData
extends java.lang.Object

SHPData - This class stores all of the geometric data for a given map. Note that a map is made up of shapes, each of which may have many parts. Note that a part is a single polygon. Note that all data stored inside this class is in geographic coordinates, meaning latitude and longitude, where east is positive and west is negative, north is positive and south is negative.

Author:
Richard McKenna

Constructor Summary
SHPData()
          This constructor just sets up our shapes data structure.
 
Method Summary
 void addShape(SHPShape shapeToAdd)
          This method will add a shape to the vector shapes.
 int getFileCode()
          This method will return the file code.
 int getFileLength()
          This method will return the file length.
 double[] getMBounds()
          This method will return the Mbounds.
 double[] getMBR()
          This method will return the MBR.
 SHPShape getShape(int index)
          This method will return a SHPShpae at a specific index.
 java.util.Vector<SHPShape> getShapes()
          This method will return the shapes.
 int getShapeType()
          This method will return the shape type.
 int[] getUnusedBytes()
          This method will return the Unused bytes.
 int getVersion()
          This method will return the version.
 double[] getZBounds()
          This method will return the ZBounds.
 void setFileCode(int initFileCode)
          This method will set the file code to the new input value.
 void setFileLength(int initFileLength)
          This method will set the file length to the new input value.
 void setMBounds(double[] initMBounds)
          This method will set the MBounds to the new input value.
 void setMBR(double[] initMBR)
          This method will set the MBR to the new input value.
 void setShapes(java.util.Vector<SHPShape> initShapes)
          This method will set the shapes to the new input value.
 void setShapeType(int initShapeType)
          This method will set the shape type to the new input value.
 void setUnusedBytes(int[] initUnusedBytes)
          This method will set the unused bytes to the new input value.
 void setVersion(int initVersion)
          This method will set the version to the new input value.
 void setZBounds(double[] initZBounds)
          This method will set the ZBounds to the new input value.
 java.util.Iterator<SHPShape> shapesIterator()
          This method will create an iterator for going through all the SHPShapes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHPData

public SHPData()
This constructor just sets up our shapes data structure. The geometric data will be loaded and unloaded as needed.

Method Detail

getFileCode

public int getFileCode()
This method will return the file code.

Returns:
The file code.

getFileLength

public int getFileLength()
This method will return the file length.

Returns:
The file length.

getMBounds

public double[] getMBounds()
This method will return the Mbounds.

Returns:
The MBounds.

getMBR

public double[] getMBR()
This method will return the MBR.

Returns:
The MBR.

getShape

public SHPShape getShape(int index)
This method will return a SHPShpae at a specific index.

Parameters:
index - The location of the data.
Returns:
The data at the specified location.

getShapeType

public int getShapeType()
This method will return the shape type.

Returns:
The shape type.

getShapes

public java.util.Vector<SHPShape> getShapes()
This method will return the shapes.

Returns:
A vector of all the shapes.

getUnusedBytes

public int[] getUnusedBytes()
This method will return the Unused bytes.

Returns:
The unused bytes.

getVersion

public int getVersion()
This method will return the version.

Returns:
The version.

getZBounds

public double[] getZBounds()
This method will return the ZBounds.

Returns:
The ZBounds.

shapesIterator

public java.util.Iterator<SHPShape> shapesIterator()
This method will create an iterator for going through all the SHPShapes.

Returns:
An iterator for all the SHPShape data.

addShape

public void addShape(SHPShape shapeToAdd)
This method will add a shape to the vector shapes.

Parameters:
shapeToAdd - The shape that will be added.

setShapes

public void setShapes(java.util.Vector<SHPShape> initShapes)
This method will set the shapes to the new input value.

Parameters:
initShapes - The new Shape.

setFileCode

public void setFileCode(int initFileCode)
This method will set the file code to the new input value.

Parameters:
initFileCode - The new file code length.

setUnusedBytes

public void setUnusedBytes(int[] initUnusedBytes)
This method will set the unused bytes to the new input value.

Parameters:
initUnusedBytes - The new unused bytes vlaue.

setFileLength

public void setFileLength(int initFileLength)
This method will set the file length to the new input value.

Parameters:
initFileLength - The new file length.

setVersion

public void setVersion(int initVersion)
This method will set the version to the new input value.

Parameters:
initVersion - The new version value.

setShapeType

public void setShapeType(int initShapeType)
This method will set the shape type to the new input value.

Parameters:
initShapeType - The new shape type.

setMBR

public void setMBR(double[] initMBR)
This method will set the MBR to the new input value.

Parameters:
initMBR - The new MBR value.

setZBounds

public void setZBounds(double[] initZBounds)
This method will set the ZBounds to the new input value.

Parameters:
initZBounds - The new ZBOunds value..

setMBounds

public void setMBounds(double[] initMBounds)
This method will set the MBounds to the new input value.

Parameters:
initMBounds - The new MBounds value.