Class IncludeExcludeFilter

java.lang.Object
net.sf.basedb.util.IncludeExcludeFilter
All Implemented Interfaces:
DynamicFilter

public class IncludeExcludeFilter
extends Object
implements DynamicFilter
Version:
2.0
Author:
Nicklas
Last modified
$Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
  • Field Details

    • filter

      private final Restriction filter
    • includeLimit

      private final int includeLimit
    • excludeLimit

      private final int excludeLimit
    • positionCount

      private final Map<Integer,​Integer> positionCount
  • Constructor Details

  • Method Details

    • configureQuery

      public void configureQuery​(SqlQuery query)
      We need the position which is in column 2 (already selected). If the limits leave a gap we also need to know if a spot matches the filter or not.
      Specified by:
      configureQuery in interface DynamicFilter
      Parameters:
      query - The query to configure
    • useIncludeSpot

      public boolean useIncludeSpot()
      Always true.
      Specified by:
      useIncludeSpot in interface DynamicFilter
      Returns:
      TRUE or FALSE
    • includeSpot

      public boolean includeSpot​(SqlResult data) throws SQLException
      Check if a spot should be included in the filtered output or not.
      Specified by:
      includeSpot in interface DynamicFilter
      Parameters:
      data - The current data row to check
      Returns:
      TRUE if the spot passed the filter, FALSE otherwise
      Throws:
      SQLException - If running SQL statement fails.