org.geotools.catalog.defaults
Class DefaultResolveDelta

java.lang.Object
  extended byorg.geotools.catalog.defaults.DefaultResolveDelta
All Implemented Interfaces:
ResolveDelta

public class DefaultResolveDelta
extends java.lang.Object
implements ResolveDelta

Catalog delta.

Since:
0.6.0

Nested Class Summary
 
Nested classes inherited from class org.geotools.catalog.ResolveDelta
ResolveDelta.Kind
 
Field Summary
 
Fields inherited from interface org.geotools.catalog.ResolveDelta
NO_CHILDREN
 
Constructor Summary
DefaultResolveDelta(Resolve handle, java.util.List changes)
          Delta for a changed handle, ie handle state refresh.
DefaultResolveDelta(Resolve handle, ResolveDelta.Kind kind)
          Simple change used for Add and Remove with no children
DefaultResolveDelta(Resolve handle, ResolveDelta.Kind kind, java.util.List changes)
          Delta for a specific change
DefaultResolveDelta(Resolve handle, Resolve newHandle, java.util.List changes)
          Delta for handle repalcement.
 
Method Summary
 void accept(ResolveDeltaVisitor visitor)
          Accepts the given visitor.
 java.util.List getChildren()
          Resource deltas for all added, removed, changed, or replaced.
 java.util.List getChildren(java.util.Set kindMask)
          Finds and returns the delta information for a given resource.
 ResolveDelta.Kind getKind()
          Returns the kind of this delta.
 Resolve getNewResolve()
          For replacement (REPLACE), this handle describes the resource in the "after" state.
 Resolve getResolve()
          Returns a handle for the affected handle.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultResolveDelta

public DefaultResolveDelta(Resolve handle,
                           java.util.List changes)
Delta for a changed handle, ie handle state refresh.

Used to communicate that new Info is available and labels should be refreshed.

Parameters:
handle - DOCUMENT ME!
changes - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

DefaultResolveDelta

public DefaultResolveDelta(Resolve handle,
                           ResolveDelta.Kind kind)
Simple change used for Add and Remove with no children

Parameters:
handle - DOCUMENT ME!
kind - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

DefaultResolveDelta

public DefaultResolveDelta(Resolve handle,
                           ResolveDelta.Kind kind,
                           java.util.List changes)
Delta for a specific change

Parameters:
handle - DOCUMENT ME!
kind - DOCUMENT ME!
changes - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

DefaultResolveDelta

public DefaultResolveDelta(Resolve handle,
                           Resolve newHandle,
                           java.util.List changes)
Delta for handle repalcement.

Used to indicate the actual connection used by the handle has been replaced. Layers should foget everything they no and latch onto the newHandle.

Parameters:
handle - DOCUMENT ME!
newHandle - DOCUMENT ME!
changes - DOCUMENT ME!
Method Detail

accept

public void accept(ResolveDeltaVisitor visitor)
            throws java.io.IOException
Description copied from interface: ResolveDelta
Accepts the given visitor.

The only kinds of resource delta that our visited are ADDED, REMOVED, CHANGED and REPLACED.

This is a convenience method, equivalent to accepts( visitor, IService.NONE )

Specified by:
accept in interface ResolveDelta
Parameters:
visitor -
Throws:
java.io.IOException

getChildren

public java.util.List getChildren()
Description copied from interface: ResolveDelta
Resource deltas for all added, removed, changed, or replaced.

This is a short cut for:


  finally List list = new ArrayList();
  accept( IServiceDeltaVisitor() {
  public boolean visit(IResolveDelta delta) {
          switch (delta.getKind()) {
          case IDelta.ADDED :
          case IDelta.REMOVED :
          case IDelta.CHANGED :
          case IDelta.REPLACED :
              list.add( delta );
          default: // ignore    
          }
      return true;
      }
  });
  return list.toArray();
 

Specified by:
getChildren in interface ResolveDelta
Returns:
A list of type ResolveDelta.

getChildren

public java.util.List getChildren(java.util.Set kindMask)
Description copied from interface: ResolveDelta
Finds and returns the delta information for a given resource.

Specified by:
getChildren in interface ResolveDelta
Returns:
Array of IGeoResourceDelta

getKind

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

Normally, one of ADDED, REMOVED, CHANGED or REPLACED.

This set is still open, during shutdown we may throw a few more kinds around. Eclipse makes use of PHANTOM, and NON_PHANTOM not sure we care

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

getResolve

public Resolve getResolve()
Description copied from interface: ResolveDelta
Returns a handle for the affected handle.

For additions (ADDED), this handle describes the newly-added resolve; i.e., the one in the "after" state.

For changes (CHANGED), this handle also describes the resource in the "after" state.

For removals (REMOVED), this handle describes the resource in the "before" state. Even though this handle not normally exist in the current workspace, the type of resource that was removed can be determined from the handle.

For removals (REPLACE), this handle describes the resource in the "before" state. The new handle can be determined with getNewResolve().

Specified by:
getResolve in interface ResolveDelta
Returns:
the affected resource (handle)

getNewResolve

public Resolve getNewResolve()
Description copied from interface: ResolveDelta
For replacement (REPLACE), this handle describes the resource in the "after" state. The old handle can be determined with getResolve().

Specified by:
getNewResolve in interface ResolveDelta
Returns:
The new resolve replacing the affected handle.

toString

public java.lang.String toString()


Copyright © GeoTools. All Rights Reserved.