com.ooyala.android.item.AdSpotManager< T extends AdSpot > Class Template Reference

A helper class help us to manage ad spots. More...

Public Member Functions

 AdSpotManager ()
 
void resetAds ()
 Mark all adspots as unplayed. More...
 
void clear ()
 Clear all adspots. More...
 
void insertAd (T ad)
 Insert an adSpot TODO Collections.sort is called everytime an ad is loaded causing this time to n2logn instead of nlogn. More...
 
boolean checkAdPlayed (T ad)
 Check if the ad was played already. More...
 
List< T > getAdList ()
 Get the List of ads held by this AdsManager. More...
 
void insertAds (List<? extends T > adSpots)
 Insert an adSpot. More...
 
adBeforeTime (int time)
 get the adspot before a certain time, More...
 
getFirstAd ()
 Return the first ad in the AdSpot List. More...
 
getLastAd ()
 Return the last ad in the AdSpot List. More...
 
void markAsPlayed (T ad)
 mark an adspot as played More...
 
int size ()
 get the adspot list size More...
 
boolean isEmpty ()
 Check if the AdSpot List is empty. More...
 
boolean allADSPlayed ()
 Check if all ADS have played. More...
 
void setAlignment (int alignment)
 set the time alignment More...
 
int getAlignment ()
 get the time alignment More...
 
Set< Integer > getCuePointsInMilliSeconds ()
 

Detailed Description

A helper class help us to manage ad spots.

Constructor & Destructor Documentation

Member Function Documentation

T com.ooyala.android.item.AdSpotManager< T extends AdSpot >.adBeforeTime ( int  time)

get the adspot before a certain time,

Parameters
timein millisecond
Returns
the unplayed adspot before the specified time which, null if no such adspot
boolean com.ooyala.android.item.AdSpotManager< T extends AdSpot >.allADSPlayed ( )

Check if all ADS have played.

Returns
true if the AdSpot List's size equals Played ADS List's size, false otherwise.
boolean com.ooyala.android.item.AdSpotManager< T extends AdSpot >.checkAdPlayed ( ad)

Check if the ad was played already.

Parameters
adthe ad to check
Returns
true if this ad was already played. false otherwise.
void com.ooyala.android.item.AdSpotManager< T extends AdSpot >.clear ( )

Clear all adspots.

List<T> com.ooyala.android.item.AdSpotManager< T extends AdSpot >.getAdList ( )

Get the List of ads held by this AdsManager.

Returns
the List of ads held by this AdsManager
int com.ooyala.android.item.AdSpotManager< T extends AdSpot >.getAlignment ( )

get the time alignment

Returns
the alignment in millisecond
Set<Integer> com.ooyala.android.item.AdSpotManager< T extends AdSpot >.getCuePointsInMilliSeconds ( )
T com.ooyala.android.item.AdSpotManager< T extends AdSpot >.getFirstAd ( )

Return the first ad in the AdSpot List.

Returns
the first ad in the AdSpot List if there is one and null otherwise
T com.ooyala.android.item.AdSpotManager< T extends AdSpot >.getLastAd ( )

Return the last ad in the AdSpot List.

Returns
the last ad in the AdSpot List if there is one and null otherwise
void com.ooyala.android.item.AdSpotManager< T extends AdSpot >.insertAd ( ad)

Insert an adSpot TODO Collections.sort is called everytime an ad is loaded causing this time to n2logn instead of nlogn.

Parameters
adthe adSpot to insert
void com.ooyala.android.item.AdSpotManager< T extends AdSpot >.insertAds ( List<? extends T >  adSpots)

Insert an adSpot.

Parameters
adSpotsthe adSpot list to insert
boolean com.ooyala.android.item.AdSpotManager< T extends AdSpot >.isEmpty ( )

Check if the AdSpot List is empty.

Returns
true if the AdSpot List is empty. false otherwise.
void com.ooyala.android.item.AdSpotManager< T extends AdSpot >.markAsPlayed ( ad)

mark an adspot as played

Parameters
adthe adspot to be marked
void com.ooyala.android.item.AdSpotManager< T extends AdSpot >.resetAds ( )

Mark all adspots as unplayed.

void com.ooyala.android.item.AdSpotManager< T extends AdSpot >.setAlignment ( int  alignment)

set the time alignment

Parameters
alignmentin millisecond
int com.ooyala.android.item.AdSpotManager< T extends AdSpot >.size ( )

get the adspot list size

Returns
size