Package com.brightcove.ssai.ad
Class AdPod
- java.lang.Object
-
- com.brightcove.ssai.ad.AdPod
-
public class AdPod extends java.lang.ObjectA representation of an Ad pod. An Ad pod is a sequenced group of Ads.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAdBreak(AdBreak adBreak)Adds an Ad break.static AdPodcreate(long relativeStartPosition)Creates an Ad pod with a empty list ofAdBreaks.static AdPodcreate(long relativeStartPosition, java.util.Deque<AdBreak> adBreaks)Creates an Ad pod with a given list ofAdBreaks.static AdPodempty()Creates an Ad pod with a empty list ofAdBreaks.longgetAbsoluteEndPosition()Gets the absolute end position.longgetAbsoluteStartPosition()Gets the absolute start position.Ad<?>getAdAt(long absolutePosition)Gets ad at a given absolute position.AdBreakgetAdBreakAt(long absolutePosition)Gets ad break at a given absolute position.java.util.Collection<AdBreak>getAdBreakList()Gets the Ad break list.longgetDuration()Gets the total Ad pod duration.longgetRelativeStartPosition()Gets the relative start position.booleanisEmpty()
-
-
-
Method Detail
-
empty
public static AdPod empty()
Creates an Ad pod with a empty list ofAdBreaks.- Returns:
- the ad pod
-
isEmpty
public boolean isEmpty()
- Returns:
- Returns true if this AdPod contains no AdBreaks
-
create
public static AdPod create(long relativeStartPosition)
Creates an Ad pod with a empty list ofAdBreaks.- Parameters:
relativeStartPosition- the relative start position- Returns:
- the ad pod
-
create
public static AdPod create(long relativeStartPosition, @NonNull java.util.Deque<AdBreak> adBreaks)
Creates an Ad pod with a given list ofAdBreaks.- Parameters:
relativeStartPosition- the relative start positionadBreaks- the ad breaks- Returns:
- the ad pod
-
getAdBreakList
public java.util.Collection<AdBreak> getAdBreakList()
Gets the Ad break list.- Returns:
- the ad break list
-
addAdBreak
public void addAdBreak(AdBreak adBreak)
Adds an Ad break.- Parameters:
adBreak- the ad break
-
getRelativeStartPosition
public long getRelativeStartPosition()
Gets the relative start position.- Returns:
- the relative start position
-
getAbsoluteStartPosition
public long getAbsoluteStartPosition()
Gets the absolute start position.- Returns:
- the start position
-
getAbsoluteEndPosition
public long getAbsoluteEndPosition()
Gets the absolute end position.- Returns:
- the end position
-
getDuration
public long getDuration()
Gets the total Ad pod duration.- Returns:
- the duration
-
getAdBreakAt
@Nullable public AdBreak getAdBreakAt(long absolutePosition)
Gets ad break at a given absolute position.- Parameters:
absolutePosition- the absolute position- Returns:
- the ad break at
-
getAdAt
@Nullable public Ad<?> getAdAt(long absolutePosition)
Gets ad at a given absolute position.- Parameters:
absolutePosition- the absolute position- Returns:
- the ad at given absolutePosition.
-
-