com.google.cloud.dataflow.sdk.transforms

## Class ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique

All Implemented Interfaces:
  Serializable

Enclosing class:
  ApproximateUnique.ApproximateUniqueCombineFn<T>

    public static class ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique
    extends Object
    implements Serializable

A heap utility class to efficiently track the largest added elements.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`LargestUnique(long sampleSize)` Creates a heap to track the largest `sampleSize` elements.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `add(Long value)` Adds a value to the heap, returning whether the value is (large enough to be) in the heap.
`List<Long>` `extractOrderedList()` Returns the values in the heap, ordered largest to smallest.

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

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

### Constructor Detail

#### LargestUnique

    public LargestUnique(long sampleSize)

Creates a heap to track the largest `sampleSize` elements.

Parameters:
  `sampleSize` - the size of the heap

### Method Detail

#### add

    public boolean add(Long value)

Adds a value to the heap, returning whether the value is (large enough to be) in the heap.

#### extractOrderedList

    public List<Long> extractOrderedList()

Returns the values in the heap, ordered largest to smallest.