com.f1j.ss.filter
Interface Filter


public interface Filter
extends Lockable

This interface describes the filters for fields in an AutoFilter.

Since:
11.0
See Also:
AutoFilter

Inner Class Summary
static class Filter.EOperator
          Enumeration class for defining operators.
 
Field Summary
static int kMaxTop10Value
          The maximum number of items that can be shown in a top 10 filter.
 
Method Summary
 void apply(boolean isTop, int numItems, boolean wantPercentage)
          Apply top 10 criteria to filter this field.
 void apply(java.lang.String criteria)
          Applies the given criteria and filters the field.
 void apply(java.lang.String criteria1, Filter.EOperator op, java.lang.String criteria2)
          Applies the given criteria and filters the field.
 java.lang.String getCriteria1()
          Returns the value of first criteria.
 java.lang.String getCriteria2()
          Returns the value of second criteria.
 java.lang.String getName()
          Returns the field name.
 int getNumUniqueValues()
          Returns the number of unique values in this field.
 Filter.EOperator getOperator()
          Returns the operator that is currently being used in this filter.
 int getTop10Criteria()
          Returns the number of items to show in top 10 filter.
 java.lang.String getUniqueValue(int index)
          Returns the unique value in the field at the specified index.
 boolean isOn()
          Indicates whether the filter is currently on (hiding data).
 void showAll()
          Shows all of the items in the filter.
 
Methods inherited from interface com.f1j.util.Lockable
getLock, releaseLock
 

Field Detail

kMaxTop10Value

public static final int kMaxTop10Value
The maximum number of items that can be shown in a top 10 filter.
Since:
11.0
Method Detail

apply

public void apply(java.lang.String criteria)
           throws F1Exception
Applies the given criteria and filters the field.
Parameters:
criteria - The criteria that should be used to filter this field (example: ">=abc"). Use "=" to find blank fields, or use "<>" to find nonblank fields.
Throws:
F1Exception - if cannot apply filtering criteria.
Since:
11.0

apply

public void apply(java.lang.String criteria1,
                  Filter.EOperator op,
                  java.lang.String criteria2)
           throws F1Exception
Applies the given criteria and filters the field. If the operator is one of the top 10 types, then criteria1 is optional and can be used to specify the number of items (for example, "10"). By default, the number of items is 10.
Parameters:
criteria1 - The criteria that should be used to filter this field (example: ">=abc"). Use "=" to find blank fields, or use "<>" to find nonblank fields.
op - Th operator that should be used to filter this field.
criteria2 - An optional second criteria that can be used to filter this field. Use null if no second criteria.
Throws:
F1Exception - if cannot apply filtering criteria.
Since:
11.0
See Also:
Filter.EOperator

apply

public void apply(boolean isTop,
                  int numItems,
                  boolean wantPercentage)
           throws F1Exception
Apply top 10 criteria to filter this field. Convenience method for top 10 criteria: calling apply(true, 20, true) is equivalent to calling apply("20", eTop10Percent, null)
Parameters:
isTop - true = if want top items to be displayed rather than bottom items.
numItems - Indicates the number of items to show or the percentage if wantPercentage is true.
wantPercentage - true = if want top percentage of items rather than the number of items.
Throws:
F1Exception - if cannot apply filtering criteria.
Since:
11.0

getCriteria1

public java.lang.String getCriteria1()
Returns the value of first criteria.
Returns:
The value of the first criteria.
Since:
11.0

getCriteria2

public java.lang.String getCriteria2()
Returns the value of second criteria.
Returns:
The value of the second criteria.
Since:
11.0

getName

public java.lang.String getName()
Returns the field name.
Returns:
The name of the field that this filter is associated with.
Since:
11.0

getNumUniqueValues

public int getNumUniqueValues()
Returns the number of unique values in this field.
Returns:
The number of unique values in this field.
Since:
11.0

getOperator

public Filter.EOperator getOperator()
Returns the operator that is currently being used in this filter.
Returns:
The operator that is currently being used in this filter.
Since:
11.0
See Also:
Filter.EOperator

getTop10Criteria

public int getTop10Criteria()
Returns the number of items to show in top 10 filter.
Returns:
The number of items to show in top 10 filter.
Since:
11.0

getUniqueValue

public java.lang.String getUniqueValue(int index)
Returns the unique value in the field at the specified index.
Returns:
The unique value in the field at the specified index.
Since:
11.0

isOn

public boolean isOn()
Indicates whether the filter is currently on (hiding data).
Returns:
true if the filter is currently on.
Since:
11.0

showAll

public void showAll()
             throws F1Exception
Shows all of the items in the filter. Turns filtering off.
Throws:
F1Exception - if cannot show all.
Since:
11.0