gistoolkit.datasources.memory
Class MemoryDataSource

java.lang.Object
  extended bygistoolkit.datasources.SimpleDataSource
      extended bygistoolkit.datasources.memory.MemoryDataSource
All Implemented Interfaces:
DataSource

public class MemoryDataSource
extends SimpleDataSource

This data source only exists in memory. It does not contain it's own persistent storage.

Version:
Author:
ithaqua

Field Summary
 
Fields inherited from class gistoolkit.datasources.SimpleDataSource
 
Constructor Summary
MemoryDataSource()
          Creates new MemoryDataSource
MemoryDataSource(java.lang.String inName)
          Creates a new MemoryDataSource with the given name
MemoryDataSource(java.lang.String inName, GISDataset inDataset)
          Creates new MemoryDataSource beginning with the given dataset
 
Method Summary
 void doCommit()
          Commit all changes since the last commit.
 void doDelete(Record inRecord)
          Delete this record from the database.
 void doInsert(Record inRecord)
          Inserts the given record into the datasource.
 void doRollback()
          Rollback any changes to this datasource since the last commit.
 void doUpdate(Record inRecord)
          Update the data source with the changed record.
 java.lang.String[] getAttributeNames()
          Returns the list of attribute names for this data source.
 AttributeType[] getAttributeTypes()
          Returns the list of attribute types for this data source.
 java.lang.String getName()
          Returns the identifier string for the datasource.
 Node getNode()
          Get the configuration information for this data source
 Style getStyle()
          Get the style to use with this datasource.
 boolean isUpdateable()
          Determines if this datasource is updateable.
 void load(java.util.Properties inProperties)
          Initialize the data source from the properties.
 GISDataset readDataset()
          Reads all the objects from the data source.
 Envelope readEnvelope()
          Returns the bounding rectangle of all the shapes in the Data Source.
protected  GISDataset readShapes(Envelope inEnvelope)
          Reads only the objects from the data source that intersect these envelope.
 void setAttributeNamesAndTypes(java.lang.String[] inAttributeNames, AttributeType[] inAttributeTypes)
          Method to set the attributes, names and types for this data source.
 void setName(java.lang.String inName)
          Sets an identifier string for the datasource.
 void setNode(Node inNode)
          Set the configuration information for this data source
 
Methods inherited from class gistoolkit.datasources.SimpleDataSource
addDataSourceListener, clearCache, commit, delete, filterDataset, fireCommit, fireDelete, fireInsert, fireRead, fireRollBack, fireUpdate, getCached, getCacheDataset, getCacheEnvelope, getEnvelope, getFilter, getFromProjection, getToProjection, getValidShapeTypes, insert, isCachedProjected, projectBackward, projectForward, queryFromCache, readDataset, removeDataSourceListener, rollback, setCache, setCached, setFilter, setFromProjection, setProjection, setToProjection, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryDataSource

public MemoryDataSource()
Creates new MemoryDataSource


MemoryDataSource

public MemoryDataSource(java.lang.String inName)
Creates a new MemoryDataSource with the given name


MemoryDataSource

public MemoryDataSource(java.lang.String inName,
                        GISDataset inDataset)
Creates new MemoryDataSource beginning with the given dataset

Method Detail

setName

public void setName(java.lang.String inName)
Sets an identifier string for the datasource.

Specified by:
setName in interface DataSource
Overrides:
setName in class SimpleDataSource

getName

public java.lang.String getName()
Returns the identifier string for the datasource.

Specified by:
getName in interface DataSource
Overrides:
getName in class SimpleDataSource

getAttributeNames

public java.lang.String[] getAttributeNames()
Returns the list of attribute names for this data source.


getAttributeTypes

public AttributeType[] getAttributeTypes()
Returns the list of attribute types for this data source.


setAttributeNamesAndTypes

public void setAttributeNamesAndTypes(java.lang.String[] inAttributeNames,
                                      AttributeType[] inAttributeTypes)
Method to set the attributes, names and types for this data source. The existing records in the data source will be updated with the new table structure. As much of the existing data that can be converted will be.


doInsert

public void doInsert(Record inRecord)
              throws java.lang.Exception
Inserts the given record into the datasource. Nulls are not allowed in the memory datasource.

Overrides:
doInsert in class SimpleDataSource
Throws:
java.lang.Exception

doCommit

public void doCommit()
              throws java.lang.Exception
Commit all changes since the last commit.

Overrides:
doCommit in class SimpleDataSource
Throws:
java.lang.Exception

load

public void load(java.util.Properties inProperties)
Initialize the data source from the properties.


readEnvelope

public Envelope readEnvelope()
                      throws java.lang.Exception
Returns the bounding rectangle of all the shapes in the Data Source.

Specified by:
readEnvelope in class SimpleDataSource
Throws:
java.lang.Exception

isUpdateable

public boolean isUpdateable()
Determines if this datasource is updateable.

Specified by:
isUpdateable in interface DataSource
Overrides:
isUpdateable in class SimpleDataSource

doDelete

public void doDelete(Record inRecord)
              throws java.lang.Exception
Delete this record from the database.

Overrides:
doDelete in class SimpleDataSource
Throws:
java.lang.Exception

doUpdate

public void doUpdate(Record inRecord)
              throws java.lang.Exception
Update the data source with the changed record.

Overrides:
doUpdate in class SimpleDataSource
Throws:
java.lang.Exception

doRollback

public void doRollback()
                throws java.lang.Exception
Rollback any changes to this datasource since the last commit.

Overrides:
doRollback in class SimpleDataSource
Throws:
java.lang.Exception

readDataset

public GISDataset readDataset()
                       throws java.lang.Exception
Reads all the objects from the data source.

Specified by:
readDataset in interface DataSource
Overrides:
readDataset in class SimpleDataSource
Throws:
java.lang.Exception

getNode

public Node getNode()
Get the configuration information for this data source

Specified by:
getNode in interface DataSource
Overrides:
getNode in class SimpleDataSource

setNode

public void setNode(Node inNode)
             throws java.lang.Exception
Set the configuration information for this data source

Specified by:
setNode in interface DataSource
Overrides:
setNode in class SimpleDataSource
Throws:
java.lang.Exception

readShapes

protected GISDataset readShapes(Envelope inEnvelope)
                         throws java.lang.Exception
Reads only the objects from the data source that intersect these envelope.

Specified by:
readShapes in class SimpleDataSource
Throws:
java.lang.Exception

getStyle

public Style getStyle()
Get the style to use with this datasource.

Specified by:
getStyle in interface DataSource
Overrides:
getStyle in class SimpleDataSource