Package com.helger.css.media
Interface ICSSMediaList
-
- All Known Implementing Classes:
CSSMediaList
public interface ICSSMediaList
A 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 boolean
containsMedium(ECSSMedium eMedium)
Check if the passed medium is explicitly specifieddefault boolean
containsMediumOrAll(ECSSMedium eMedium)
Check if the passed medium or theECSSMedium.ALL
is explicitly specifiedcom.helger.commons.collection.impl.ICommonsOrderedSet<ECSSMedium>
getAllMedia()
int
getMediaCount()
default String
getMediaString()
String
getMediaString(String sSeparator)
default boolean
hasAnyMedia()
boolean
hasNoMedia()
default boolean
hasNoMediaOrAll()
default boolean
isForScreen()
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:
true
if any explicit media is defined,false
if not.
-
hasNoMedia
boolean hasNoMedia()
- Returns:
true
if no explicit media is defined,false
if a media is defined.
-
hasNoMediaOrAll
default boolean hasNoMediaOrAll()
- Returns:
true
if no explicit media is defined or ifECSSMedium.ALL
is 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:
true
if it is contained,false
otherwise
-
containsMediumOrAll
default boolean containsMediumOrAll(@Nullable ECSSMedium eMedium)
Check if the passed medium or theECSSMedium.ALL
is explicitly specified- Parameters:
eMedium
- The medium to be checked. May benull
.- Returns:
true
if the passed medium or the "all" medium is contained,false
otherwise
-
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:
true
if 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
null
but maybe empty.
-
getMediaString
@Nonnull default String getMediaString()
- Returns:
- A non-
null
but maybe empty String with all media in the order they where inserted and separated byCSSMediaList.DEFAULT_MEDIA_STRING_SEPARATOR
- See Also:
getMediaString(String)
-
-