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 booleanacceptsRow(T rowObject)Returns true if this filter matches the given row (data)booleanequals(java.lang.Object obj)TableFilter<?>getFilter(int index)Returns the filter at the given index into the list of sub filters.intgetFilterCount()Returns the number of sub-filters in this combined filter.booleanhasColumnFilter(int modelIndex)Returns true if the there is a column filter on the column specifiedinthashCode()booleanisEmpty()A method that allows filters to report that they have nothing to actually filter.booleanisSubFilterOf(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:TableFilterReturns true if this filter matches the given row (data)- Specified by:
acceptsRowin 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:TableFilterA method that allows filters to report that they have nothing to actually filter. This is useful for empty/null filters.- Specified by:
isEmptyin 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:TableFilterReturns 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:
isSubFilterOfin 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:TableFilterReturns true if the there is a column filter on the column specified- Specified by:
hasColumnFilterin 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-