2.17.2: 2011-06-17

net.sf.basedb.util
Class IncludeExcludeFilter

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

public class IncludeExcludeFilter
extends Object
implements DynamicFilter

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Field Summary
private  int excludeLimit
           
private  Restriction filter
           
private  int includeLimit
           
private  Map<Integer,Integer> positionCount
           
 
Constructor Summary
IncludeExcludeFilter(DbControl dc, BioAssaySet bas, List<BioAssay> bioAssays, Restriction filter, Integer includeLimit, Integer excludeLimit)
           
 
Method Summary
 void configureQuery(SqlQuery query)
          We need the position which is in column 2 (already selected).
 boolean includeSpot(SqlResult data)
          Check if a spot should be included in the filtered output or not.
 boolean useIncludeSpot()
          Always true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

private final Restriction filter

includeLimit

private final int includeLimit

excludeLimit

private final int excludeLimit

positionCount

private final Map<Integer,Integer> positionCount
Constructor Detail

IncludeExcludeFilter

public IncludeExcludeFilter(DbControl dc,
                            BioAssaySet bas,
                            List<BioAssay> bioAssays,
                            Restriction filter,
                            Integer includeLimit,
                            Integer excludeLimit)
Method Detail

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.

2.17.2: 2011-06-17