Summary: Ctors | Methods | Inherited Methods | [Expand All]
public final class

# Correlator

extends Object

java.lang.Object
↳ | com.google.android.gms.ads.Correlator

## Class Overview

A `Correlator` is used to associate multiple ad views on the same page. When the same `Correlator` is attached to multiple ad objects, on the next ad load or refresh, they will start serving correlated ads.

This code provides a sample on how this class is used for two banners that should serve correlated ads:

         Correlator correlator = new Correlator();

         PublisherAdView topBannerView = new PublisherAdView(this);
         topBannerView.setAdSize(...);
         topBannerView.setAdUnitId(...);
         topBannerView.setCorrelator(correlator);

         PublisherAdView bottomBannerView = new PublisherAdView(this);
         bottomBannerView.setAdSize(...);
         bottomBannerView.setAdUnitId(...);
         bottomBannerView.setCorrelator(correlator);

         topBannerView.loadAd(adRequest);
         bottomBannerView.loadAd(adRequest);

If the app wants to load a different set of correlated ads, the refresh can be forced as following:

         correlator.reset();
         topBannerView.loadAd(adRequest);
         bottomBannerView.loadAd(adRequest);

##### See Also

- `setCorrelator(Correlator)`
- `setCorrelator(Correlator)`
- `withCorrelator(Correlator)`

## Summary

Public Constructors
| Correlator() Create a new `Correlator`.

Public Methods
void | reset() Reset this `Correlator` object.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public Correlator ()

Create a new `Correlator`.

## Public Methods

#### public void reset ()

Reset this `Correlator` object. The ad views attached to it will not be forced refreshed, however on the next load or refresh, they will start serving a new set of correlated ads. This method essentially starts a new page view for the attached ad views.