public class

SVSAdRule

extends Object
implements Parcelable Serializable Comparable<T>
java.lang.Object
   ↳ com.smartadserver.android.instreamsdk.adrules.SVSAdRule

Class Overview

Class representing an ad rule for a a particular media duration.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors
SVSAdRule(long minDuration, long maxDuration, SVSAdRuleData[] adRuleDatas)
Constructor
SVSAdRule(long minDuration, long maxDuration, SVSAdRuleData[] adRuleDatas, long minimumDelayBetweenAdBreaks)
Constructor
Public Methods
int compareTo(SVSAdRule otherAdRule)
Compare this SVSAdRule to another SVSAdRule for ordering
SVSAdRuleData getAdRuleData(SVSAdBreakType adBreakType)
Returns the SVSAdRuleData associated with a given ad break type if available.
SVSAdRuleData[] getAdRuleDatas()
Returns the array of SVSAdRuleData for this SVSAdRule
long getMaxDuration()
Returns the maximum duration (in milliseconds) of the media for which this rule can be applied
long getMinDuration()
Returns the minimum duration (in milliseconds) of the media for which this rule can be applied
long getMinimumDelayBetweenAdBreaks()
Returns the minimum time in milliseconds (absolute time, not playback time) between displaying ad breaks
boolean hasAdBreak(SVSAdBreakType adBreakType)
Returns whether the ad break rule defines an ad break for a given type.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface java.lang.Comparable

Public Constructors

public SVSAdRule (long minDuration, long maxDuration, SVSAdRuleData[] adRuleDatas)

Constructor

Parameters
minDuration minimum duration (in milliseconds) for a content video to match this rule
maxDuration maximum duration (in milliseconds) for a content video to match this rule
adRuleDatas an array of SVSAdRuleData objects defining the ad breaks of this ad rule
Throws
IllegalArgumentException

public SVSAdRule (long minDuration, long maxDuration, SVSAdRuleData[] adRuleDatas, long minimumDelayBetweenAdBreaks)

Constructor

Parameters
minDuration minimum duration (in milliseconds) for a content video to match this rule
maxDuration maximum duration (in milliseconds) for a content video to match this rule
adRuleDatas an array of SVSAdRuleData objects defining the ad breaks of this ad rule
minimumDelayBetweenAdBreaks the minimum absolute time (in milliseconds) to respect between 2 consecutive ad breaks
Throws
IllegalArgumentException

Public Methods

public int compareTo (SVSAdRule otherAdRule)

Compare this SVSAdRule to another SVSAdRule for ordering

public SVSAdRuleData getAdRuleData (SVSAdBreakType adBreakType)

Returns the SVSAdRuleData associated with a given ad break type if available.

Parameters
adBreakType the ad break type.
Returns
  • the SVSAdRuleData associated with a given ad break type if available, null otherwise.

public SVSAdRuleData[] getAdRuleDatas ()

Returns the array of SVSAdRuleData for this SVSAdRule

public long getMaxDuration ()

Returns the maximum duration (in milliseconds) of the media for which this rule can be applied

public long getMinDuration ()

Returns the minimum duration (in milliseconds) of the media for which this rule can be applied

public long getMinimumDelayBetweenAdBreaks ()

Returns the minimum time in milliseconds (absolute time, not playback time) between displaying ad breaks

public boolean hasAdBreak (SVSAdBreakType adBreakType)

Returns whether the ad break rule defines an ad break for a given type.

Parameters
adBreakType the ad break type.
Returns
  • true if the ad break type is defined, false otherwise.