org.geotools.event
Class GTDeltaImpl

java.lang.Object
  extended byorg.geotools.event.GTDeltaImpl
All Implemented Interfaces:
GTDelta

public class GTDeltaImpl
extends java.lang.Object
implements GTDelta

Describes the extent of changes.

The "delta" acts as a series of bread crumbs allowing you the listener to figure out what changed where.

Since:
2.2.M3

Nested Class Summary
 
Nested classes inherited from class org.geotools.event.GTDelta
GTDelta.Kind
 
Field Summary
 
Fields inherited from interface org.geotools.event.GTDelta
NO_CHILDREN, NO_INDEX
 
Constructor Summary
GTDeltaImpl(GTNote notification, GTDelta.Kind kind, java.lang.Object value, java.lang.Object oldValue)
          Create a delta, with no children.
GTDeltaImpl(GTNote notification, GTDelta.Kind kind, java.lang.Object value, java.lang.Object oldValue, GTDelta delta)
          Create a delta with with a list element child delta.
GTDeltaImpl(GTNote notification, GTDelta.Kind kind, java.lang.Object value, java.lang.Object oldValue, java.util.List children)
          Create a delta, completely specifying all values.
GTDeltaImpl(GTNote notification, java.lang.Object before, java.lang.Object after)
          Does the right thing, aka magic.
 
Method Summary
 void accept(GTDeltaVisitor visitor)
          Accepts the given visitor.
 java.util.List getChildren()
          Finds and returns deltas for specificly changed constructs.
 GTDelta.Kind getKind()
          Returns the kind of this delta.
 java.lang.String getName()
          Name of property being affected.
 java.lang.Object getOldValue()
          Construct being replaced with a changed, getValue is the replacing value.
 int getPosition()
          Position in a "list" where the change occured, or NO_INDEX.
 java.lang.Object getValue()
          Affected construct, getKind & getChildern indicate specific details of the change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GTDeltaImpl

public GTDeltaImpl(GTNote notification,
                   java.lang.Object before,
                   java.lang.Object after)
Does the right thing, aka magic.

This constructor is provided to make things easier, if your experience is not magic please skip this and try the next constructor.

Magic:

Parameters:
notification -
before -
after -

GTDeltaImpl

public GTDeltaImpl(GTNote notification,
                   GTDelta.Kind kind,
                   java.lang.Object value,
                   java.lang.Object oldValue)
Create a delta, with no children.

Parameters:
notification -
kind -
value -
oldValue -

GTDeltaImpl

public GTDeltaImpl(GTNote notification,
                   GTDelta.Kind kind,
                   java.lang.Object value,
                   java.lang.Object oldValue,
                   GTDelta delta)
Create a delta with with a list element child delta.

This can be used to communicate a batch of changes, such as adding and removing sections from a list, or the results of a transformation.

Parameters:
notification -
kind -
value -
oldValue -
delta -

GTDeltaImpl

public GTDeltaImpl(GTNote notification,
                   GTDelta.Kind kind,
                   java.lang.Object value,
                   java.lang.Object oldValue,
                   java.util.List children)
Create a delta, completely specifying all values.

Parameters:
notification -
kind -
value -
oldValue -
children -
Method Detail

getName

public java.lang.String getName()
Description copied from interface: GTDelta
Name of property being affected.

Specified by:
getName in interface GTDelta
Returns:
name of affected Child, or null for root

getPosition

public int getPosition()
Description copied from interface: GTDelta
Position in a "list" where the change occured, or NO_INDEX.

Specified by:
getPosition in interface GTDelta
Returns:
Position in "list" or NO_INDEX.

getKind

public GTDelta.Kind getKind()
Description copied from interface: GTDelta
Returns the kind of this delta.

Normally, one of ADDED, REMOVED or CHANGED.

Specified by:
getKind in interface GTDelta
Returns:
the kind of this resource delta
See Also:
Kind.ADDED, Kind.REMOVED, Kind.CHANGED

getValue

public java.lang.Object getValue()
Description copied from interface: GTDelta
Affected construct, getKind & getChildern indicate specific details of the change.

Specified by:
getValue in interface GTDelta
Returns:
Affected construct

getOldValue

public java.lang.Object getOldValue()
Description copied from interface: GTDelta
Construct being replaced with a changed, getValue is the replacing value.

Specified by:
getOldValue in interface GTDelta
Returns:
Affected construct

getChildren

public java.util.List getChildren()
Description copied from interface: GTDelta
Finds and returns deltas for specificly changed constructs.

This code may be considered more accessable then the use of GTDeltaVisitor.

Specified by:
getChildren in interface GTDelta
Returns:
List of StyleDelta

accept

public void accept(GTDeltaVisitor visitor)
Description copied from interface: GTDelta
Accepts the given visitor.

Specified by:
accept in interface GTDelta
Parameters:
visitor -


Copyright © GeoTools. All Rights Reserved.