Package docking.widgets.table
Class CombinedTableFilter<T>
- java.lang.Object
-
- docking.widgets.table.CombinedTableFilter<T>
-
- Type Parameters:
T
- the type of table row objects.
- All Implemented Interfaces:
TableFilter<T>
public class CombinedTableFilter<T> extends java.lang.Object implements TableFilter<T>
Combines multiple Table Filters into a single TableFilter that can be applied. All contained filters must pass for this combined filter to pass.
-
-
Constructor Summary
Constructors Constructor Description CombinedTableFilter(TableFilter<T> filter1, TableFilter<T> filter2, TableFilter<T> filter3)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsRow(T rowObject)
Returns true if this filter matches the given row (data)boolean
equals(java.lang.Object obj)
TableFilter<?>
getFilter(int index)
Returns the filter at the given index into the list of sub filters.int
getFilterCount()
Returns the number of sub-filters in this combined filter.boolean
hasColumnFilter(int modelIndex)
Returns true if the there is a column filter on the column specifiedint
hashCode()
boolean
isEmpty()
A method that allows filters to report that they have nothing to actually filter.boolean
isSubFilterOf(TableFilter<?> tableFilter)
Returns true if this filter is a more specific version of the given filter.
-
-
-
Constructor Detail
-
CombinedTableFilter
public CombinedTableFilter(TableFilter<T> filter1, TableFilter<T> filter2, TableFilter<T> filter3)
-
-
Method Detail
-
acceptsRow
public boolean acceptsRow(T rowObject)
Description copied from interface:TableFilter
Returns true if this filter matches the given row (data)- Specified by:
acceptsRow
in interfaceTableFilter<T>
- Parameters:
rowObject
- the current row object- Returns:
- true if the element at the given row matches this filter.
-
isEmpty
public boolean isEmpty()
Description copied from interface:TableFilter
A method that allows filters to report that they have nothing to actually filter. This is useful for empty/null filters.- Specified by:
isEmpty
in interfaceTableFilter<T>
- Returns:
- true if this filter will not perform any filtering
-
getFilterCount
public int getFilterCount()
Returns the number of sub-filters in this combined filter.- Returns:
- the number of sub-filters in this combined filter.
-
getFilter
public TableFilter<?> getFilter(int index)
Returns the filter at the given index into the list of sub filters.- Parameters:
index
- the index of the filter to retrieve- Returns:
- the i'th filter.
-
isSubFilterOf
public boolean isSubFilterOf(TableFilter<?> tableFilter)
Description copied from interface:TableFilter
Returns true if this filter is a more specific version of the given filter.For example, if this filter is a 'starts with' text filter, with the value of 'bobo', then if the given filter is also a 'starts with' filter, with a value of 'bob', then this filter is considered a sub-filter of the given sub-filter.
- Specified by:
isSubFilterOf
in interfaceTableFilter<T>
- Parameters:
tableFilter
- the filter to check- Returns:
- true if this filter is a sub-filter of the given filter
-
hasColumnFilter
public boolean hasColumnFilter(int modelIndex)
Description copied from interface:TableFilter
Returns true if the there is a column filter on the column specified- Specified by:
hasColumnFilter
in interfaceTableFilter<T>
- Parameters:
modelIndex
- the model index of the column to test for column filters.- Returns:
- true if the there is a column filter on the column specified.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-