public static < S extends Storable > Cursor < S > applyFilter ( Filter < S > filter , FilterValues < S > filterValues , Cursor < S > cursor ) { if ( filter . isOpen ( ) ) { return cursor ; } if ( filter . isClosed ( ) ) { throw new IllegalArgumentException ( ) ; } // Make sure the filter is the same one that filterValues should be using. filter = filter . bind ( ) ; Object [ ] values = filterValues == null ? null : filterValues . getValuesFor ( filter ) ; return FilteredCursorGenerator . getFactory ( filter ) . newFilteredCursor ( cursor , values ) ; }
Returns a Cursor that is filtered by the given Filter and FilterValues . The given Filter must be composed only of the same PropertyFilter instances as used to construct the FilterValues . An IllegalStateException will result otherwise .