gistoolkit.datasources
Class GISDataset

java.lang.Object
  extended bygistoolkit.datasources.GISDataset
Direct Known Subclasses:
ShapeFileDataset

public class GISDataset
extends java.lang.Object

Container for shapes and associated attribute data.

This class contains a collection of records.


Field Summary
protected  java.lang.String[] myAttributeNames
          Collection of names for attribute data.
protected  Envelope myEnvelope
          Bounds of the data in the geo dataset.
protected  java.util.Vector myVectRecords
          Vector of object arrays for the attributes.
 
Constructor Summary
GISDataset()
          Layer constructor comment.
GISDataset(Record[] inRecords)
          Create a new Dataset with the given records.
GISDataset(java.lang.String[] inAttributeNames)
          Create a new layer with the given number of attributes.
GISDataset(java.lang.String[] inAttributeNames, AttributeType[] inAttributeTypes)
          Create a new Dataset with the given number and type of attributes.
 
Method Summary
 void add(java.lang.Object[] inAttributeValues, Shape inShape)
          Add a data item to the list .
 void add(Record inRecord)
          Add a data item to the list .
 java.lang.Object clone()
          Make a deep copy of this data set.
 int getAttributeCount()
          Return the number of attributes.
 java.lang.String getAttributeName(int inIndex)
          Return the attribute name at the given index.
 java.lang.String[] getAttributeNames()
          Return the attribute names.
 AttributeType getAttributeType(int inIndex)
          Return the attribute type at the given index.
 AttributeType[] getAttributeTypes()
          Return teh attribute types.
 java.lang.Object getAttributeValue(int inRow, int inCol)
          Return the attribute at the given offset.
 java.lang.Object[] getAttributeValues(int inRow)
          Return the attributes at the given offset.
 Envelope getEnvelope()
          Return the Envelope of the data in the dataset.
 int getIndex(Shape inShape)
          If the shape is contained within the data set, this returns the index of the first instance of that shape.
 int getNumShapes()
          Deprecated. This method is being deprecated in vavor of size();
 Record getRecord(int inIndex)
          Returns the record for the current selected dataset.
 int getRecordCount()
          Return the number of recordsd in this layer.
 Record[] getRecords()
          Returns the records within this dataset
 Shape getShape(int index)
          Return the shape at the given index.
 Point getSnappedPoint(double worldX, double worldY, Converter tempConverter)
          Return the snapped Point to this dataset
protected  void resetEnvelope()
          Used to recalculate the envelope when the dataset is reprojected.
 int size()
          Return the number of recordsd in this layer.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myAttributeNames

protected java.lang.String[] myAttributeNames
Collection of names for attribute data.


myVectRecords

protected java.util.Vector myVectRecords
Vector of object arrays for the attributes.


myEnvelope

protected Envelope myEnvelope
Bounds of the data in the geo dataset.

Constructor Detail

GISDataset

public GISDataset()
Layer constructor comment.


GISDataset

public GISDataset(java.lang.String[] inAttributeNames)
Create a new layer with the given number of attributes.


GISDataset

public GISDataset(java.lang.String[] inAttributeNames,
                  AttributeType[] inAttributeTypes)
Create a new Dataset with the given number and type of attributes.


GISDataset

public GISDataset(Record[] inRecords)
Create a new Dataset with the given records. They should all have the same names, types and number of attributes.

Method Detail

clone

public java.lang.Object clone()
Make a deep copy of this data set. Could be a large amount of memory, so avoid if possible.


add

public void add(java.lang.Object[] inAttributeValues,
                Shape inShape)
Add a data item to the list .


add

public void add(Record inRecord)
Add a data item to the list .


getAttributeCount

public int getAttributeCount()
Return the number of attributes.


getAttributeName

public java.lang.String getAttributeName(int inIndex)
Return the attribute name at the given index.


getAttributeType

public AttributeType getAttributeType(int inIndex)
Return the attribute type at the given index.


getAttributeNames

public java.lang.String[] getAttributeNames()
Return the attribute names.


getAttributeTypes

public AttributeType[] getAttributeTypes()
Return teh attribute types.


getAttributeValue

public java.lang.Object getAttributeValue(int inRow,
                                          int inCol)
Return the attribute at the given offset.


getAttributeValues

public java.lang.Object[] getAttributeValues(int inRow)
Return the attributes at the given offset.


getEnvelope

public Envelope getEnvelope()
Return the Envelope of the data in the dataset.


resetEnvelope

protected void resetEnvelope()
Used to recalculate the envelope when the dataset is reprojected.


getNumShapes

public int getNumShapes()
Deprecated. This method is being deprecated in vavor of size();


getRecordCount

public int getRecordCount()
Return the number of recordsd in this layer.


size

public int size()
Return the number of recordsd in this layer.


getRecord

public Record getRecord(int inIndex)
Returns the record for the current selected dataset.


getRecords

public Record[] getRecords()
Returns the records within this dataset


getShape

public Shape getShape(int index)
Return the shape at the given index.


getIndex

public int getIndex(Shape inShape)
If the shape is contained within the data set, this returns the index of the first instance of that shape. If the shape does not exist, then a -1 is returned.


getSnappedPoint

public Point getSnappedPoint(double worldX,
                             double worldY,
                             Converter tempConverter)
Return the snapped Point to this dataset