public abstract class AbstractMediaPackageElementSelector<T extends MediaPackageElement> extends Object implements MediaPackageElementSelector<T>
MediaPackageElements from a MediaPackage that matches the tag
and flavors.| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
excludeTags
The tags to exclude
|
protected List<MediaPackageElementFlavor> |
flavors
The flavors
|
static String |
NEGATE_TAG_PREFIX
The prefix indicating that a tag should be excluded from a search for elements using
MediaPackage.getElementsByTags(Collection) |
protected Set<String> |
tags
The tags
|
| Constructor and Description |
|---|
AbstractMediaPackageElementSelector() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFlavor(MediaPackageElementFlavor flavor)
Adds the given flavor to the list of flavors.
|
void |
addFlavor(String flavor)
Adds the given flavor to the list of flavors.
|
void |
addFlavorAt(int index,
MediaPackageElementFlavor flavor)
Adds the given flavor to the list of flavors.
|
void |
addFlavorAt(int index,
String flavor)
Adds the given flavor to the list of flavors.
|
void |
addTag(String tag)
Adds
tag to the list of tags that are used to select the media. |
void |
clearTags()
Removes all of the tags from this selector.
|
MediaPackageElementFlavor[] |
getFlavors()
Returns the list of flavors.
|
String[] |
getTags()
Returns the tags.
|
void |
removeFlavor(MediaPackageElementFlavor flavor)
Removes all occurences of the given flavor from the list of flavors.
|
void |
removeFlavor(String flavor)
Removes all occurences of the given flavor from the list of flavors.
|
void |
removeFlavorAt(int index)
Removes all occurences of the given flavor from the list of flavors.
|
void |
removeTag(String tag)
Adds
tag to the list of tags that are used to select the media. |
Collection<T> |
select(List<MediaPackageElement> elements,
boolean withTagsAndFlavors)
Returns the media package elements that are matched by this selector.
|
Collection<T> |
select(MediaPackage mediaPackage,
boolean withTagsAndFlavors)
This base implementation will return those media package elements that match the type specified as the type
parameter to the class and that flavor (if specified) AND at least one of the tags (if specified) match.
|
void |
setFlavors(List<MediaPackageElementFlavor> flavors)
Sets the flavors.
|
protected List<MediaPackageElementFlavor> flavors
public static final String NEGATE_TAG_PREFIX
MediaPackage.getElementsByTags(Collection)public Collection<T> select(MediaPackage mediaPackage, boolean withTagsAndFlavors)
select in interface MediaPackageElementSelector<T extends MediaPackageElement>mediaPackage - the media packagewithTagsAndFlavors - define if the elements must match with flavors and tags, or just one of these parametersMediaPackageElementSelector.select(org.opencastproject.mediapackage.MediaPackage,
boolean)public Collection<T> select(List<MediaPackageElement> elements, boolean withTagsAndFlavors)
MediaPackageElementSelectorselect in interface MediaPackageElementSelector<T extends MediaPackageElement>elements - the elements to select fromwithTagsAndFlavors - define if the elements must match with flavors and tags, or just one of these parameterspublic void setFlavors(List<MediaPackageElementFlavor> flavors)
Note that the order is relevant to the selection of the track returned by this selector.
flavors - the list of flavorsIllegalArgumentException - if the flavors list is nullpublic void addFlavor(MediaPackageElementFlavor flavor)
Note that the order is relevant to the selection of the track returned by this selector.
flavor - public void addFlavor(String flavor)
Note that the order is relevant to the selection of the track returned by this selector.
flavor - public void addFlavorAt(int index,
MediaPackageElementFlavor flavor)
Note that the order is relevant to the selection of the track returned by this selector.
index - the position in the listflavor - the flavor to addpublic void addFlavorAt(int index,
String flavor)
Note that the order is relevant to the selection of the track returned by this selector.
index - the position in the listflavor - the flavor to addpublic void removeFlavor(MediaPackageElementFlavor flavor)
flavor - the flavor to removepublic void removeFlavor(String flavor)
flavor - the flavor to removepublic void removeFlavorAt(int index)
index - the position in the listpublic MediaPackageElementFlavor[] getFlavors()
public void addTag(String tag)
tag to the list of tags that are used to select the media.tag - the tag to includepublic void removeTag(String tag)
tag to the list of tags that are used to select the media.tag - the tag to includepublic String[] getTags()
public void clearTags()
Copyright © 2009–2020 Opencast Project. All rights reserved.