com.extentech.ExtenXLS
Class AutoFilterHandle

java.lang.Object
  extended by com.extentech.ExtenXLS.AutoFilterHandle
All Implemented Interfaces:
Handle

public class AutoFilterHandle
extends Object
implements Handle

AutoFilterHandle allows for manipulation of the AutoFilters within the Spreadsheet AutoFilters allow for

Author:
John McMahon :: Sep 14, 2010 :: Copyright ©2011Extentech Inc.

Method Summary
 int getCol()
          returns the column this AutoFilter is applied to
NOTE: this may not be 100% exact
 String getOp()
          get the operator associated with this AutoFilter
NOTE: this will return the operator in the first condition if this AutoFilter contains two conditions
Use getOp2 to retrieve the second condition operator
 String getVal()
          returns the String representation of the comparison value for this AutoFilter, if any
This will return the comparison value of the first condition for those AutoFilters containing two conditions
 String getVal2()
          returns the String representation of the second comparison value for this AutoFilter, if any
This will return the comparison value of the second condition for those AutoFilters containing two conditions
 boolean isFilterBlanks()
          returns true if this AutoFitler is set to filter all blank rows
 boolean isFilterNonBlanks()
          returns true if this AutoFitler is set to filter all non-blank rows
 boolean isTop10()
          returns true if this AutoFilter is set to Top-10
Top-n filters only show the Top n values or percent in the column
 void setFilterBlanks()
          sets this AutoFilter to filter all blank rows
 void setFilterNonBlanks()
          sets this AutoFilter to filter all non-blank rows
 void setTop10(int n, boolean percent, boolean top10)
          Sets this AutoFilter to be a Top-n or Bottom-n type of filter
Top-n filters only show the Top n values or percent in the column
Bottom-n filters only show the bottom n values or percent in the column
n can be from 1-500, or 0 to turn off Top 10 filtering
 void setVal(Object val, String op)
          Sets the custom comparison of this AutoFilter via a String operator and an Object value
Only those rows that meet the equation: (column value) OP value will be shown
e.g show all rows where column value >= 2.99
 void setVal2(Object val, String op, boolean AND)
          Sets the custom comparison of the second condition of this AutoFilter via a String operator and an Object value
This method sets the second condition of a two-condition filter
 String toString()
          returns the string representation of this AutoFilter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()
returns the string representation of this AutoFilter

Overrides:
toString in class Object
Returns:
the string representation of this AutoFilter

getCol

public int getCol()
returns the column this AutoFilter is applied to
NOTE: this may not be 100% exact

Returns:
in column number

setVal

public void setVal(Object val,
                   String op)
Sets the custom comparison of this AutoFilter via a String operator and an Object value
Only those rows that meet the equation: (column value) OP value will be shown
e.g show all rows where column value >= 2.99

Object value can be of type

String
Boolean
Error
a Number type object

String operator may be one of: "=", ">", ">=", "<>", "<", "<="

Parameters:
Object - val - value to set
String - op - operator
See Also:
setVal2

setVal2

public void setVal2(Object val,
                    String op,
                    boolean AND)
Sets the custom comparison of the second condition of this AutoFilter via a String operator and an Object value
This method sets the second condition of a two-condition filter

Only those rows that meet the equation:
first condition AND/OR (column value) OP value will be shown
e.g show all rows where (column value) <= 1.99 AND (column value) >= 2.99

Object value can be of type

String
Boolean
Error
a Number type object

String operator may be one of: "=", ">", ">=", "<>", "<", "<="

Parameters:
Object - val - value to set
String - op - operator
boolean - AND - true if two conditions should be AND'ed, false if OR'd
See Also:
setVal2

getVal

public String getVal()
returns the String representation of the comparison value for this AutoFilter, if any
This will return the comparison value of the first condition for those AutoFilters containing two conditions

Returns:
String comparison value for the second condition or null if none exists
See Also:
getVal2

getVal2

public String getVal2()
returns the String representation of the second comparison value for this AutoFilter, if any
This will return the comparison value of the second condition for those AutoFilters containing two conditions

Returns:
String comparison value for the second condition or null if none exists
See Also:
getVal

getOp

public String getOp()
get the operator associated with this AutoFilter
NOTE: this will return the operator in the first condition if this AutoFilter contains two conditions
Use getOp2 to retrieve the second condition operator

Returns:
String operator

setTop10

public void setTop10(int n,
                     boolean percent,
                     boolean top10)
Sets this AutoFilter to be a Top-n or Bottom-n type of filter
Top-n filters only show the Top n values or percent in the column
Bottom-n filters only show the bottom n values or percent in the column
n can be from 1-500, or 0 to turn off Top 10 filtering

Parameters:
int - n - 0-500
boolean - percent - true if show Top-n percent; false to show Top-n items
boolean - top10 - true if show Top-n (items or percent), false to show Bottom-n (items or percent)

isTop10

public boolean isTop10()
returns true if this AutoFilter is set to Top-10
Top-n filters only show the Top n values or percent in the column

Returns:

setFilterBlanks

public void setFilterBlanks()
sets this AutoFilter to filter all blank rows


setFilterNonBlanks

public void setFilterNonBlanks()
sets this AutoFilter to filter all non-blank rows


isFilterBlanks

public boolean isFilterBlanks()
returns true if this AutoFitler is set to filter all blank rows

Returns:
true if filter blanks, false otherwise

isFilterNonBlanks

public boolean isFilterNonBlanks()
returns true if this AutoFitler is set to filter all non-blank rows

Returns:
true if filter non-blanks, false otherwise


Copyright © 2011 Extentech Inc. All Rights Reserved.