Interface UpdatableBeforeCondition

All Known Implementing Classes:
AndCondition, NeighborhoodCondition, WrapAsUpdatable

public interface UpdatableBeforeCondition
A two-stage process for checking if two ObjectMasks should be merged.

This interface allows for a more efficient checking process:

  1. Set the source object (which may involve costly pre-computations)
  2. Check multiple destination objects against the pre-computed source

This approach is particularly useful for operations like growing object-masks to check for neighboring objects.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(ObjectMask destination)
    Checks if the destination object should be merged with the previously set source object.
    void
    updateSourceObject(ObjectMask source, Optional<UnitConverter> unitConverter)
    Updates the source object and performs any necessary pre-computations.
  • Method Details

    • updateSourceObject

      void updateSourceObject(ObjectMask source, Optional<UnitConverter> unitConverter) throws OperationFailedException
      Updates the source object and performs any necessary pre-computations.
      Parameters:
      source - the source ObjectMask
      unitConverter - an optional UnitConverter for unit conversions
      Throws:
      OperationFailedException - if the update operation fails
    • accept

      boolean accept(ObjectMask destination) throws OperationFailedException
      Checks if the destination object should be merged with the previously set source object.
      Parameters:
      destination - the destination ObjectMask to check against the source
      Returns:
      true if the objects should be merged, false otherwise
      Throws:
      OperationFailedException - if the check operation fails