Interface ICSSMediaList

  • All Known Implementing Classes:
    CSSMediaList

    public interface ICSSMediaList
    A read only version of a CSS media list
    Author:
    Philip Helger
    • 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 if ECSSMedium.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 be null.
        Returns:
        true if it is contained, false otherwise
      • containsMediumOrAll

        default boolean containsMediumOrAll​(@Nullable
                                            ECSSMedium eMedium)
        Check if the passed medium or the ECSSMedium.ALL is explicitly specified
        Parameters:
        eMedium - The medium to be checked. May be null.
        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
        String getMediaString​(@Nonnull
                              String sSeparator)
        Parameters:
        sSeparator - The separator to be used. May not be null.
        Returns:
        A non-null but maybe empty String with all media in the order they where inserted and separated by the specified separator