# Class Filter<T extends Summary>

java.lang.Object
org.apache.datasketches.tuple.Filter<T>

Type Parameters:
  `T` - Summary type against which apply the `Predicate`

public class Filter<T extends Summary> extends Object
Class for filtering entries from a `TupleSketch` given a `Summary`

## Constructor Summary

Constructors
Constructor
Description
`Filter(Predicate<T> predicate)`
Filter constructor with a `Predicate`

## Method Summary

Modifier and Type
Method
Description
`CompactTupleSketch<T>`
`filter(TupleSketch<T> sketchIn)`
Filters elements on the provided `TupleSketch`

### Methods inherited from class Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Filter

public Filter(Predicate<T> predicate)
Filter constructor with a `Predicate`

Parameters:
  `predicate` - Predicate to use in this filter. If the Predicate returns False, the element is discarded. If the Predicate returns True, then the element is kept in the `TupleSketch`

## Method Details

### filter

public CompactTupleSketch<T> filter(TupleSketch<T> sketchIn)
Filters elements on the provided `TupleSketch`

Parameters:
  `sketchIn` - The sketch against which to apply the `Predicate`
Returns:
  A new CompactTupleSketch with some of the entries filtered out based on the `Predicate`