Class AbstractDataSet
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.model.AbstractDataSet
-
public abstract class AbstractDataSet extends java.lang.Object
Abstract class to represent editable data sets
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANNOTATION_TEXT_SET
protected java.util.Hashtable<java.lang.String,java.lang.String>
attrJavaTypes
Loaded attributes and their java types.protected java.lang.String
baseTable
Database table nameprotected EditChangeManager
changeCache
Change cache manager to stores the editing history.protected AbstractDataModel
dataModel
Parent data model.protected java.lang.String
datasetName
Generic name.protected java.util.Hashtable<java.lang.String,AbstractFeature>
features
Abstract features.protected int
geomDimension
Geometry dimension.static java.lang.String
GEOMETRY_SET
Data sets typesprotected java.lang.String
geometryColumn
Geometry column name.protected long
geomSRID
Data Spatial reference ID.protected boolean
hasGeodeticSRID
protected AbstractIndexedDataSet
indexedSet
The indexed set owning this objectprotected java.lang.String
keyColumn
Key column name.protected int
mode
Access modeprotected java.util.Vector<java.lang.String>
nonNullAttributes
Names of non complex attributes that are not null (key attribute must be there).protected java.lang.String
queryCondition
Query condition to be added to final query for filteringstatic int
READ_ONLY_SET
Access modes: read only or read write.static int
READ_WRITE_SET
protected java.lang.String
sequenceName
Database sequence name to allow retrieval of new keys.static java.lang.String
TOPOLOGY_FEATURE_SET
protected java.lang.String
type
Data set typeprotected java.awt.geom.Rectangle2D
workingArea
Data set loaded area.protected java.lang.String
workspace
-
Constructor Summary
Constructors Constructor Description AbstractDataSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addFeature(AbstractFeature feature)
Adds a new feature to the data set if data set is read-write mode.void
addToNonNullAttributes(java.lang.String attr)
Adds the attribute name to the list of non null attributes.protected void
adjustColumnNames()
Adjusts key column and spatial column names to the values in list of attributes.boolean
appendFeature(AbstractFeature feature)
Appends a feature to current list of the data set features.void
clearChanges()
Clears the change cache.void
clearFeatures()
Removes all features and clears the change cache.boolean
deleteFeature(java.lang.String key)
Removes a feature from the current list of the data set features.java.lang.String
getAttributeJavaType(java.lang.String attrName)
java.lang.String[]
getAttributeNames()
Returns the attribute names (spatial and non-spatial) that can be edited.java.lang.String
getBaseTable()
java.lang.String[]
getChangedAttributesOfModifiedFeature(java.lang.String key)
Returns the attribute names of modified features that have the values changed.AbstractDataModel
getDataModel()
AbstractFeature
getFeature(java.lang.String key)
oracle.mapviewer.share.Field
getFeatureAttribute(java.lang.String key, java.lang.String attrName)
java.lang.String
getFeatureKeyValue(AbstractFeature feat)
Returns the feature key valuejava.util.List<GeoObject>
getFeatures()
Returns the current set of features.java.lang.Object
getFeatureSpatialAttribute(java.lang.String key)
java.lang.String
getGeometryColumn()
int
getGeometryDimensions()
long
getGeometrySrid()
AbstractIndexedDataSet
getIndexedSet()
java.lang.String
getKeyColumn()
java.lang.String
getKeyColumnJavaType()
int
getMode()
java.lang.String[]
getModifiedFeatures()
java.lang.String
getName()
Returns the data set name.java.lang.String[]
getNewFeatures()
java.util.Vector<java.lang.String>
getNonNullAttributes()
Returns the a list of non complex attributes that can not have null values.java.lang.String
getQueryCondition()
java.lang.String
getQueryForLoading()
java.lang.String
getRealKeyValue(java.lang.String keyColumn, java.lang.String keyValue)
Returns the real key value being used in the data set.java.lang.String[]
getRemovedFeatures()
java.lang.String
getSequenceName()
java.lang.String
getType()
java.awt.geom.Rectangle2D
getWorkingArea()
java.lang.String
getWorkspace()
boolean
hasGeodeticSRID()
Returns if data set has geodetic SRID.boolean
hasSpatialAttributeChanged(java.lang.String key)
Returns if spatial attribute of modified feature has changed.boolean
isInEditMode()
Returns if data set can be edited (read-write mode).boolean
isModified()
boolean
isModifiedFeature(java.lang.String key)
boolean
isNewFeature(java.lang.String key)
boolean
isNonNullAttribute(java.lang.String attr)
Returns if attribute is a non null attribute.boolean
isRemovedFeature(java.lang.String key)
boolean
loadData(AbstractDataAccessObject da, java.awt.geom.Rectangle2D mbr, WorkSpace workspace, int mode)
boolean
loadMetaData(AbstractDataAccessObject da)
boolean
put(AbstractFeature feature)
Adds the feature to feature list, but no changes are recorded.void
redo(EditChangeEvent change)
boolean
removeFeature(java.lang.String key)
Removes a feature from the data set if data set is read-write mode.boolean
save(AbstractDataAccessObject da)
Commit data set changes.java.lang.String
setAttributeJavaType(java.lang.String attrName, java.lang.String attrType)
void
setDataModel(AbstractDataModel model)
void
setHoldLayerUpdate(boolean value)
void
setIndexedSet(AbstractIndexedDataSet indexedSet)
void
setName(java.lang.String name)
Sets the data set name.void
setQueryCondition(java.lang.String condition)
void
setSequenceName(java.lang.String sequence)
void
setSpatialInfo(java.lang.String tableName, java.lang.String keyColumn, java.lang.String geomColumn)
Sets the basic spatial information for this data set.void
setWorkspace(java.lang.String workspace)
int
size()
void
undo(EditChangeEvent change)
Restores the last edit operation.boolean
updateFeatureAttribute(java.lang.String key, oracle.mapviewer.share.Field newValue)
Updates the feature attribute defined in input value if data set is read-write mode.boolean
updateFeatureAttributes(java.lang.String key, oracle.mapviewer.share.Field[] newValues)
Update feature attributes if data set is in read-write mode.boolean
updateFeatureGeometry(java.lang.String key, java.lang.Object newGeometry)
Update feature geometry if data set is in read-write mode.
-
-
-
Field Detail
-
READ_ONLY_SET
public static int READ_ONLY_SET
Access modes: read only or read write.
-
READ_WRITE_SET
public static int READ_WRITE_SET
-
GEOMETRY_SET
public static java.lang.String GEOMETRY_SET
Data sets types
-
TOPOLOGY_FEATURE_SET
public static java.lang.String TOPOLOGY_FEATURE_SET
-
ANNOTATION_TEXT_SET
public static java.lang.String ANNOTATION_TEXT_SET
-
indexedSet
protected AbstractIndexedDataSet indexedSet
The indexed set owning this object
-
datasetName
protected java.lang.String datasetName
Generic name.
-
baseTable
protected java.lang.String baseTable
Database table name
-
geometryColumn
protected java.lang.String geometryColumn
Geometry column name.
-
keyColumn
protected java.lang.String keyColumn
Key column name.
-
workspace
protected java.lang.String workspace
-
sequenceName
protected java.lang.String sequenceName
Database sequence name to allow retrieval of new keys.
-
features
protected java.util.Hashtable<java.lang.String,AbstractFeature> features
Abstract features.
-
changeCache
protected EditChangeManager changeCache
Change cache manager to stores the editing history.
-
geomDimension
protected int geomDimension
Geometry dimension.
-
geomSRID
protected long geomSRID
Data Spatial reference ID.
-
hasGeodeticSRID
protected boolean hasGeodeticSRID
-
mode
protected int mode
Access mode
-
type
protected java.lang.String type
Data set type
-
dataModel
protected AbstractDataModel dataModel
Parent data model. Data set may belong to a network or topology model.
-
workingArea
protected java.awt.geom.Rectangle2D workingArea
Data set loaded area.
-
attrJavaTypes
protected java.util.Hashtable<java.lang.String,java.lang.String> attrJavaTypes
Loaded attributes and their java types. The supported Java types are: String, Short, Integer, Long, Float, Double, BigDecimal, Date, Time, Timestamp.
-
nonNullAttributes
protected java.util.Vector<java.lang.String> nonNullAttributes
Names of non complex attributes that are not null (key attribute must be there).
-
queryCondition
protected java.lang.String queryCondition
Query condition to be added to final query for filtering
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the data set name.
-
setName
public void setName(java.lang.String name)
Sets the data set name.- Parameters:
name
-
-
setSpatialInfo
public void setSpatialInfo(java.lang.String tableName, java.lang.String keyColumn, java.lang.String geomColumn)
Sets the basic spatial information for this data set.- Parameters:
tableName
-keyColumn
-geomColumn
-
-
getBaseTable
public java.lang.String getBaseTable()
- Returns:
-
getGeometryColumn
public java.lang.String getGeometryColumn()
- Returns:
-
getKeyColumn
public java.lang.String getKeyColumn()
- Returns:
-
setSequenceName
public void setSequenceName(java.lang.String sequence)
- Parameters:
sequence
-
-
getSequenceName
public java.lang.String getSequenceName()
- Returns:
-
loadMetaData
public boolean loadMetaData(AbstractDataAccessObject da) throws java.lang.Exception, MDSException
- Throws:
java.lang.Exception
MDSException
-
loadData
public boolean loadData(AbstractDataAccessObject da, java.awt.geom.Rectangle2D mbr, WorkSpace workspace, int mode) throws java.lang.Exception, MDSException
- Parameters:
da
- data access object with opened conectionmbr
- area to load dataworkspace
- workspace parametersmode
- access mode- Returns:
- Throws:
java.lang.Exception
MDSException
-
save
public boolean save(AbstractDataAccessObject da) throws java.lang.Exception, MDSException
Commit data set changes. If data belongs to a model (network or topology), the data is not committed. For this situations, use the model save method.- Parameters:
da
- data access object with opened connection- Returns:
- Throws:
java.lang.Exception
MDSException
-
getType
public java.lang.String getType()
- Returns:
-
getMode
public int getMode()
- Returns:
-
isInEditMode
public boolean isInEditMode()
Returns if data set can be edited (read-write mode).- Returns:
-
setDataModel
public void setDataModel(AbstractDataModel model)
- Parameters:
model
-
-
getDataModel
public AbstractDataModel getDataModel()
- Returns:
-
getWorkingArea
public java.awt.geom.Rectangle2D getWorkingArea()
- Returns:
-
getAttributeJavaType
public java.lang.String getAttributeJavaType(java.lang.String attrName)
- Parameters:
attrName
-- Returns:
-
setAttributeJavaType
public java.lang.String setAttributeJavaType(java.lang.String attrName, java.lang.String attrType)
-
getAttributeNames
public java.lang.String[] getAttributeNames()
Returns the attribute names (spatial and non-spatial) that can be edited.- Returns:
-
getRealKeyValue
public java.lang.String getRealKeyValue(java.lang.String keyColumn, java.lang.String keyValue)
Returns the real key value being used in the data set. This value will be based on the key column java type.- Parameters:
keyColumn
-keyValue
-- Returns:
-
getNonNullAttributes
public java.util.Vector<java.lang.String> getNonNullAttributes()
Returns the a list of non complex attributes that can not have null values.- Returns:
-
addToNonNullAttributes
public void addToNonNullAttributes(java.lang.String attr)
Adds the attribute name to the list of non null attributes.- Parameters:
attr
-
-
isNonNullAttribute
public boolean isNonNullAttribute(java.lang.String attr)
Returns if attribute is a non null attribute.- Parameters:
attr
-- Returns:
-
getFeatureSpatialAttribute
public java.lang.Object getFeatureSpatialAttribute(java.lang.String key)
- Parameters:
key
-- Returns:
-
getFeatureAttribute
public oracle.mapviewer.share.Field getFeatureAttribute(java.lang.String key, java.lang.String attrName)
- Parameters:
key
-attrName
-- Returns:
-
getGeometryDimensions
public int getGeometryDimensions()
- Returns:
-
getGeometrySrid
public long getGeometrySrid()
- Returns:
-
getModifiedFeatures
public java.lang.String[] getModifiedFeatures()
- Returns:
-
getNewFeatures
public java.lang.String[] getNewFeatures()
- Returns:
-
getRemovedFeatures
public java.lang.String[] getRemovedFeatures()
- Returns:
-
size
public int size()
-
put
public boolean put(AbstractFeature feature)
Adds the feature to feature list, but no changes are recorded. Feature must not exists.- Parameters:
feature
-- Returns:
-
addFeature
public boolean addFeature(AbstractFeature feature) throws java.lang.Exception
Adds a new feature to the data set if data set is read-write mode. Change manager records this change.- Parameters:
feature
-- Returns:
- Throws:
java.lang.Exception
-
appendFeature
public boolean appendFeature(AbstractFeature feature) throws java.lang.Exception
Appends a feature to current list of the data set features. Change manager does not record this change. Use this method if you want to extend the feature list, but do not want to record it as a data set change.- Parameters:
feature
-- Returns:
- Throws:
java.lang.Exception
-
deleteFeature
public boolean deleteFeature(java.lang.String key) throws java.lang.Exception
Removes a feature from the current list of the data set features. Change manager does not record this change.- Parameters:
key
-- Returns:
- Throws:
java.lang.Exception
-
removeFeature
public boolean removeFeature(java.lang.String key) throws java.lang.Exception
Removes a feature from the data set if data set is read-write mode. Change manager records this change.- Parameters:
key
-- Returns:
- Throws:
java.lang.Exception
-
isRemovedFeature
public boolean isRemovedFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
isModifiedFeature
public boolean isModifiedFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
isNewFeature
public boolean isNewFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
updateFeatureAttribute
public boolean updateFeatureAttribute(java.lang.String key, oracle.mapviewer.share.Field newValue) throws java.lang.Exception
Updates the feature attribute defined in input value if data set is read-write mode. Change manager records this change.- Parameters:
key
-newValue
- contains the attribute name and value- Returns:
- Throws:
java.lang.Exception
-
updateFeatureAttributes
public boolean updateFeatureAttributes(java.lang.String key, oracle.mapviewer.share.Field[] newValues) throws java.lang.Exception
Update feature attributes if data set is in read-write mode. Change manager records this change.- Parameters:
key
-newValues
-- Returns:
- Throws:
java.lang.Exception
-
updateFeatureGeometry
public boolean updateFeatureGeometry(java.lang.String key, java.lang.Object newGeometry) throws java.lang.Exception
Update feature geometry if data set is in read-write mode. Change manager records this change.- Parameters:
key
-newGeometry
-- Returns:
- Throws:
java.lang.Exception
-
isModified
public boolean isModified()
- Returns:
-
undo
public void undo(EditChangeEvent change)
Restores the last edit operation.
-
redo
public void redo(EditChangeEvent change)
-
clearFeatures
public void clearFeatures()
Removes all features and clears the change cache.
-
clearChanges
public void clearChanges()
Clears the change cache.
-
getFeatures
public java.util.List<GeoObject> getFeatures()
Returns the current set of features.- Returns:
-
getFeature
public AbstractFeature getFeature(java.lang.String key)
- Parameters:
key
-- Returns:
-
getFeatureKeyValue
public java.lang.String getFeatureKeyValue(AbstractFeature feat)
Returns the feature key value- Parameters:
feat
-- Returns:
-
getQueryForLoading
public java.lang.String getQueryForLoading()
- Returns:
-
hasSpatialAttributeChanged
public boolean hasSpatialAttributeChanged(java.lang.String key)
Returns if spatial attribute of modified feature has changed. For new and removed features this method returns false.- Parameters:
key
-- Returns:
-
getChangedAttributesOfModifiedFeature
public java.lang.String[] getChangedAttributesOfModifiedFeature(java.lang.String key)
Returns the attribute names of modified features that have the values changed. For new and removed features this method returns null.- Parameters:
key
-- Returns:
-
setHoldLayerUpdate
public void setHoldLayerUpdate(boolean value)
-
getKeyColumnJavaType
public java.lang.String getKeyColumnJavaType()
- Returns:
-
adjustColumnNames
protected void adjustColumnNames()
Adjusts key column and spatial column names to the values in list of attributes.
-
hasGeodeticSRID
public boolean hasGeodeticSRID()
Returns if data set has geodetic SRID.- Returns:
-
getQueryCondition
public java.lang.String getQueryCondition()
- Returns:
-
setQueryCondition
public void setQueryCondition(java.lang.String condition)
- Parameters:
condition
-
-
setIndexedSet
public void setIndexedSet(AbstractIndexedDataSet indexedSet)
-
getIndexedSet
public AbstractIndexedDataSet getIndexedSet()
-
setWorkspace
public void setWorkspace(java.lang.String workspace)
-
getWorkspace
public java.lang.String getWorkspace()
-
-