org.apache.datasketches.tuple

## 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 `Sketch` given a `Summary`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`CompactSketch<T>` `filter(Sketch<T> sketchIn)` Filters elements on the provided `Sketch`

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### 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 `Sketch`

### Method Detail

#### filter

    public CompactSketch<T> filter(Sketch<T> sketchIn)

Filters elements on the provided `Sketch`

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