com.google.cloud.dataflow.sdk.transforms

## Class Count

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.Count

    public class Count
    extends Object

`PTransorm`s to count the elements in a `PCollection`.

`perElement()` can be used to count the number of occurrences of each distinct element in the PCollection, `perKey()` can be used to count the number of values per key, and `globally()` can be used to count the total number of elements in a PCollection.

### Nested Class Summary

Nested Classes
`static class` `Count.PerElement<T>` `Count.PerElement<T>` takes a `PCollection<T>` and returns a `PCollection<KV<T, Long>>` representing a map from each distinct element of the input `PCollection` to the number of times that element occurs in the input.

### Method Summary

All Methods Static Methods Concrete Methods
`static <T> Combine.Globally<T,Long>` `globally()` Returns a `Combine.Globally` `PTransform` that counts the number of elements in its input `PCollection`.
`static <T> Count.PerElement<T>` `perElement()` Returns a `Count.PerElement` `PTransform` that counts the number of occurrences of each element in its input `PCollection`.
`static <K,V> Combine.PerKey<K,V,Long>` `perKey()` Returns a `Combine.PerKey` `PTransform` that counts the number of elements associated with each key of its input `PCollection`.

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

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

### Method Detail

#### globally

    public static <T> Combine.Globally<T,Long> globally()

Returns a `Combine.Globally` `PTransform` that counts the number of elements in its input `PCollection`.

#### perKey

    public static <K,V> Combine.PerKey<K,V,Long> perKey()

Returns a `Combine.PerKey` `PTransform` that counts the number of elements associated with each key of its input `PCollection`.

#### perElement

    public static <T> Count.PerElement<T> perElement()

Returns a `Count.PerElement` `PTransform` that counts the number of occurrences of each element in its input `PCollection`.

See `Count.PerElement` for more details.