Package adql.search

Interface IReplaceHandler

All Superinterfaces:
ISearchHandler, Iterable<ADQLObject>
All Known Implementing Classes:
RemoveHandler, SimpleReplaceHandler

public interface IReplaceHandler extends ISearchHandler

Defines an interface for any kind of search/replace handler.

A replace handler is supposed to replace ADQL objects matching a given condition by another ADQL object (which may be generated on the fly if needed). In some ADQL objects (i.e. ADQLList), it is also possible to remove objects. In this case, the replacement object must be NULL.

A simple implementation of this interface already exists: SimpleReplaceHandler.

See Also:
  • Method Details

    • searchAndReplace

      void searchAndReplace(ADQLObject startObj)
      Searches all matching ADQL objects from the given ADQL object (included) and replaces them by their corresponding ADQL object.
      Parameters:
      startObj - The ADQL object from which the search must start.
    • getNbReplacement

      int getNbReplacement()
      Gets the number of matched objects which have been successfully replaced.
      Returns:
      The number of replaced objects.