Package com.helger.css.media
Interface ICSSMediaList
-
- All Known Implementing Classes:
CSSMediaList
public interface ICSSMediaListA read only version of a CSS media list- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontainsMedium(ECSSMedium eMedium)Check if the passed medium is explicitly specifieddefault booleancontainsMediumOrAll(ECSSMedium eMedium)Check if the passed medium or theECSSMedium.ALLis explicitly specifiedcom.helger.commons.collection.impl.ICommonsOrderedSet<ECSSMedium>getAllMedia()intgetMediaCount()default StringgetMediaString()StringgetMediaString(String sSeparator)default booleanhasAnyMedia()booleanhasNoMedia()default booleanhasNoMediaOrAll()default booleanisForScreen()Check if the passed medium is usable for the screen.
-
-
-
Method Detail
-
getMediaCount
@Nonnegative int getMediaCount()
- Returns:
- The number of contained media. Always ≥ 0.
-
hasAnyMedia
default boolean hasAnyMedia()
- Returns:
trueif any explicit media is defined,falseif not.
-
hasNoMedia
boolean hasNoMedia()
- Returns:
trueif no explicit media is defined,falseif a media is defined.
-
hasNoMediaOrAll
default boolean hasNoMediaOrAll()
- Returns:
trueif no explicit media is defined or ifECSSMedium.ALLis contained.
-
containsMedium
boolean containsMedium(@Nullable ECSSMedium eMedium)
Check if the passed medium is explicitly specified- Parameters:
eMedium- The medium to be checked. May benull.- Returns:
trueif it is contained,falseotherwise
-
containsMediumOrAll
default boolean containsMediumOrAll(@Nullable ECSSMedium eMedium)
Check if the passed medium or theECSSMedium.ALLis explicitly specified- Parameters:
eMedium- The medium to be checked. May benull.- Returns:
trueif the passed medium or the "all" medium is contained,falseotherwise
-
isForScreen
default boolean isForScreen()
Check if the passed medium is usable for the screen. This is the case if either the "screen" medium, the "all" medium or no medium at all is contained.- Returns:
trueif the media list is usable for screen display
-
getAllMedia
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsOrderedSet<ECSSMedium> getAllMedia()
- Returns:
- A copy of all specified media in the order they were specified.
Never
nullbut maybe empty.
-
getMediaString
@Nonnull default String getMediaString()
- Returns:
- A non-
nullbut maybe empty String with all media in the order they where inserted and separated byCSSMediaList.DEFAULT_MEDIA_STRING_SEPARATOR - See Also:
getMediaString(String)
-
-