org.geotools.data.postgis
Class FeatureDiffImpl

java.lang.Object
  extended by org.geotools.data.postgis.FeatureDiffImpl
All Implemented Interfaces:
FeatureDiff

public class FeatureDiffImpl
extends java.lang.Object
implements FeatureDiff

Represents the difference between two states of the same feature.

Since:
2.4
Author:
aaime

Field Summary
static int DELETED
          Feature existed in fromVersion, but has been deleted (change map is empty)
static int INSERTED
          Feature does not exists in fromVersion, has been created in the meantime (change map contains all attributes in this case)
static int UPDATED
          Feature exists in both versions, but has been modified
 
Constructor Summary
FeatureDiffImpl(org.opengis.feature.simple.SimpleFeature oldFeature, org.opengis.feature.simple.SimpleFeature newFeature)
          Creates a new feature difference for a modified feature
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.List getChangedAttributes()
          Returns a read only list of modified attribute names if state is FeatureDiff.UPDATED, an empty list otherwise
 org.opengis.feature.simple.SimpleFeature getFeature()
          Returns the inserted feature, if the state is FeatureDiff.INSERTED, the new feature, if the state is FeatureDiff.UPDATED, null otherwise
 java.lang.String getID()
          The feature ID
 org.opengis.feature.simple.SimpleFeature getOldFeature()
          Returns the old feature, if the state is FeatureDiff.UPDATED or FeatureDiff.DELETED, null otherwise
 int getState()
          The type of difference, either:: FeatureDiff.UPDATED FeatureDiff.INSERTED FeatureDiff.DELETED
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INSERTED

public static final int INSERTED
Feature does not exists in fromVersion, has been created in the meantime (change map contains all attributes in this case)

See Also:
Constant Field Values

UPDATED

public static final int UPDATED
Feature exists in both versions, but has been modified

See Also:
Constant Field Values

DELETED

public static final int DELETED
Feature existed in fromVersion, but has been deleted (change map is empty)

See Also:
Constant Field Values
Constructor Detail

FeatureDiffImpl

public FeatureDiffImpl(org.opengis.feature.simple.SimpleFeature oldFeature,
                       org.opengis.feature.simple.SimpleFeature newFeature)
Creates a new feature difference for a modified feature

Parameters:
ID -
oldFeature -
newFeature -
changes -
Method Detail

getChangedAttributes

public java.util.List getChangedAttributes()
Description copied from interface: FeatureDiff
Returns a read only list of modified attribute names if state is FeatureDiff.UPDATED, an empty list otherwise

Specified by:
getChangedAttributes in interface FeatureDiff
Returns:

getID

public java.lang.String getID()
Description copied from interface: FeatureDiff
The feature ID

Specified by:
getID in interface FeatureDiff
Returns:

getState

public int getState()
Description copied from interface: FeatureDiff
The type of difference, either::

Specified by:
getState in interface FeatureDiff
Returns:

getFeature

public org.opengis.feature.simple.SimpleFeature getFeature()
Description copied from interface: FeatureDiff
Returns the inserted feature, if the state is FeatureDiff.INSERTED, the new feature, if the state is FeatureDiff.UPDATED, null otherwise

Specified by:
getFeature in interface FeatureDiff

getOldFeature

public org.opengis.feature.simple.SimpleFeature getOldFeature()
Description copied from interface: FeatureDiff
Returns the old feature, if the state is FeatureDiff.UPDATED or FeatureDiff.DELETED, null otherwise

Specified by:
getOldFeature in interface FeatureDiff

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.