Class WhereFilterInvertedImpl

All Implemented Interfaces:
ConcurrencyControl<Filter>, Expression, Filter, LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, DependencyStreamProvider, WhereFilter, WhereFilterDelegating, Serializable

public class WhereFilterInvertedImpl extends WhereFilterDelegatingBase
See Also:
  • Method Details

    • of

      public static WhereFilter of(WhereFilter filter)
    • maybeUnwrapFilter

      public WhereFilter maybeUnwrapFilter()
      Description copied from interface: WhereFilterDelegating
      Returns the wrapped filter if and only if the wrapped filter accepts the same rows as this filter. For example, serial and barrier wrappers do not change functionality and will return the wrapped filter. Filters such as WhereFilterInvertedImpl that perform a transformation should return themselves.
    • filter

      @NotNull public @NotNull WritableRowSet filter(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet fullSet, @NotNull @NotNull Table table, boolean usePrev)
      Description copied from interface: WhereFilter
      Filter selection to only matching rows.
      Specified by:
      filter in interface WhereFilter
      Overrides:
      filter in class WhereFilterDelegatingBase
      Parameters:
      selection - the indices that should be filtered. The selection must be a subset of fullSet, and may include rows that the engine determines need not be evaluated to produce the result. Implementations may not mutate or close selection.
      fullSet - the complete RowSet of the table to filter. The fullSet is used for calculating variables like "i" or "ii". Implementations may not mutate or close fullSet.
      table - the table to filter
      usePrev - true if previous values should be used. Implementing previous value filtering is optional, and a WhereFilter.PreviousFilteringNotSupported exception may be thrown. If a PreviousFiltering exception is thrown, then the caller must acquire the PeriodicUpdateGraph lock.
      Returns:
      The subset of selection accepted by this filter; ownership passes to the caller
    • filterInverse

      @NotNull public @NotNull WritableRowSet filterInverse(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet fullSet, @NotNull @NotNull Table table, boolean usePrev)
      Description copied from interface: WhereFilter
      Filter selection to only non-matching rows.

      Defaults to

       
       try (final WritableRowSet regular = filter(selection, fullSet, table, usePrev)) {
           return selection.minus(regular);
       }
       
       

      Implementations are encouraged to override this when they can provide more efficient implementations.

      Specified by:
      filterInverse in interface WhereFilter
      Overrides:
      filterInverse in class WhereFilterDelegatingBase
      Parameters:
      selection - the indices that should be filtered. The selection must be a subset of fullSet, and may include rows that the engine determines need not be evaluated to produce the result. Implementations may not mutate or close selection.
      fullSet - the complete RowSet of the table to filter. The fullSet is used for calculating variables like "i" or "ii". Implementations may not mutate or close fullSet.
      table - the table to filter
      usePrev - true if previous values should be used. Implementing previous value filtering is optional, and a WhereFilter.PreviousFilteringNotSupported exception may be thrown. If a PreviousFiltering exception is thrown, then the caller must acquire the PeriodicUpdateGraph lock.
      Returns:
      The subset of selection not accepted by this filter; ownership passes to the caller
    • copy

      public WhereFilter copy()
      Description copied from interface: WhereFilter
      Create a copy of this WhereFilter.
      Returns:
      an independent copy of this WhereFilter.
    • toString

      public String toString()
      Overrides:
      toString in class ReferenceCounted
    • walk

      public final <T> T walk(WhereFilter.Visitor<T> visitor)
      Description copied from interface: WhereFilter
      This method calls the appropriate visitor method based on the type of this WhereFilter. This will invoke the most specific WhereFilter.Visitor method available.
      Type Parameters:
      T - the return value type
      Parameters:
      visitor - the visitor
      Returns:
      the value