net.refractions.udig.catalog.util
Class SearchIDDeltaVisitor

java.lang.Object
  extended by net.refractions.udig.catalog.util.SearchIDDeltaVisitor
All Implemented Interfaces:
IResolveDeltaVisitor

public class SearchIDDeltaVisitor
extends java.lang.Object
implements IResolveDeltaVisitor

Easy of use visitor for search IResolveDeltas.

After a run found == Delta that best matches the provided handle.

Will be null if no matches were found that were interesting. Where: interesting != NO_CHANGE

You can use this code as an example of a good IResolveDeltaVisitor.

Since:
0.6.0
Author:
jgarnett

Constructor Summary
SearchIDDeltaVisitor(java.net.URL id)
           
 
Method Summary
 IResolveDelta getFound()
          Best match IResolveDelta for handle, may be null if search came up empty.
static IResolveDelta search(java.net.URL id, IResolveChangeEvent event)
          Quick method that uses this visitor to search an event.
 boolean visit(IResolveDelta delta)
          Visits the given resolve delta.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchIDDeltaVisitor

public SearchIDDeltaVisitor(java.net.URL id)
Method Detail

getFound

public IResolveDelta getFound()
Best match IResolveDelta for handle, may be null if search came up empty.

Returns:
Best match IResolveDelta for handle

visit

public boolean visit(IResolveDelta delta)
Description copied from interface: IResolveDeltaVisitor
Visits the given resolve delta.

Specified by:
visit in interface IResolveDeltaVisitor
Returns:
true if the resource delta's children should be visited; false if they should be skipped.

search

public static IResolveDelta search(java.net.URL id,
                                   IResolveChangeEvent event)
Quick method that uses this visitor to search an event.

This serves as a good example of using a visitor.