public synchronized NativeAd getAdForIndex(final int index) {
        NativeAd adNative = null;
        if(index >= 0)
            adNative = (NativeAd) adMapAtIndex.get(index);

        if (adNative == null && mPrefetchedAdList.size() > 0) {
            adNative = mPrefetchedAdList.remove(0);

            if (adNative != null) {
                adMapAtIndex.put(index, adNative);
            }
        }

        ensurePrefetchAmount(); // Make sure we have enough pre-fetched ads
        return adNative;
    }
public synchronized NativeAd getAdForIndex(final int index) {
        NativeAd adNative = null;
        if(index >= 0)
            adNative = (NativeAd) adMapAtIndex.get(index);

        if (adNative == null && mPrefetchedAdList.size() > 0) {
            adNative = mPrefetchedAdList.remove(0);

            if (adNative != null) {
                adMapAtIndex.put(index, adNative);
            }
        }

        ensurePrefetchAmount(); 
        return adNative;
    }
public synchronized NativeAd getAdForIndex ( final int index ) { NativeAd adNative = null ; if ( index >= 0 ) adNative = ( NativeAd ) adMapAtIndex . get ( index ) ; if ( adNative == null && mPrefetchedAdList . size ( ) > 0 ) { adNative = mPrefetchedAdList . remove ( 0 ) ; if ( adNative != null ) { adMapAtIndex . put ( index , adNative ) ; } } ensurePrefetchAmount ( ) ; // Make sure we have enough pre-fetched ads return adNative ; }
Gets native ad at a particular index in the fetched ads list.

@param index the index of ad in the fetched ads list
@return the native ad in the list
@see #getFetchedAdsCount()
Gets native ad at a particular index in the fetched ads list .