|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDiff
public class Diff
Captures changes made to a FeatureStore prior to being committed.
This is used to simulate the functionality of a database including transaction independence.
Field Summary | |
---|---|
Map<String,SimpleFeature> |
added
Deprecated. please use getAdded() |
Map<String,SimpleFeature> |
modified2
Deprecated. Please use getModified(); |
int |
nextFID
counter used to genreate the "next" new feature id |
static SimpleFeature |
NULL
A NullObject used to represent the absence of a SimpleFeature. |
Constructor Summary | |
---|---|
Diff()
Create an empty Diff |
|
Diff(Diff other)
Diff copy. |
Method Summary | |
---|---|
void |
add(String fid,
SimpleFeature f)
|
protected void |
addToSpatialIndex(SimpleFeature f)
|
void |
clear()
Clear diff - called during rollback. |
protected Quadtree |
copySTRtreeFrom(Diff diff)
|
Map<String,SimpleFeature> |
getAdded()
Unmodifiable view of added features. |
List<String> |
getAddedOrder()
Unmodifieable list indicating the order features were added |
Map<String,SimpleFeature> |
getModified()
Unmodifiable view of modified features. |
boolean |
isEmpty()
Check if modifiedFeatures and addedFeatures are empty. |
void |
modify(String fid,
SimpleFeature f)
Record a modification to the indicated fid |
List<SimpleFeature> |
queryIndex(Envelope env)
|
void |
remove(String fid)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Map<String,SimpleFeature> modified2
Set s = diff.modified2.keySet(); // Needn't be in synchronized block ... synchronized(diff) { // Synchronizing on diff, not diff.modified2 or s! Iterator i = s.iterator(); // Must be in synchronized block while (i.hasNext()) foo(i.next()); }Failure to follow this advice may result in non-deterministic behavior.
The returned map will be serializable if the specified map is serializable.
public final Map<String,SimpleFeature> added
Set s = diff.added.keySet(); // Needn't be in synchronized block ... synchronized(diff) { // Synchronizing on m, not diff.added or s! Iterator i = s.iterator(); // Must be in synchronized block while (i.hasNext()) foo(i.next()); }Failure to follow this advice may result in non-deterministic behavior.
The returned map will be serializable if the specified map is serializable.
public int nextFID
public static final SimpleFeature NULL
This class is used by TransactionStateDiff as a placeholder to represent features that have been removed. The concept is generally useful and may wish to be taken out as a separate class (used for example to represent deleted rows in a shapefile).
Constructor Detail |
---|
public Diff()
public Diff(Diff other)
other
- Method Detail |
---|
public boolean isEmpty()
public void clear()
public void modify(String fid, SimpleFeature f)
fid
- f
- replacement feature; null to indicate removepublic void add(String fid, SimpleFeature f)
protected void addToSpatialIndex(SimpleFeature f)
public void remove(String fid)
public List<SimpleFeature> queryIndex(Envelope env)
public List<String> getAddedOrder()
public Map<String,SimpleFeature> getModified()
Set s = diff.modified2.keySet(); // Needn't be in synchronized block ... synchronized(diff) { // Synchronizing on diff, not diff.modified2 or s! Iterator i = s.iterator(); // Must be in synchronized block while (i.hasNext()) foo(i.next()); }Failure to follow this advice may result in non-deterministic behavior.
The returned map will be serializable if the specified map is serializable.
public Map<String,SimpleFeature> getAdded()
Set s = diff.added.keySet(); // Needn't be in synchronized block ... synchronized(diff) { // Synchronizing on m, not diff.added or s! Iterator i = s.iterator(); // Must be in synchronized block while (i.hasNext()) foo(i.next()); }Failure to follow this advice may result in non-deterministic behavior.
The returned map will be serializable if the specified map is serializable.
protected Quadtree copySTRtreeFrom(Diff diff)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |