Class AbstractMediaQuery

java.lang.Object
io.sf.carte.doc.style.css.parser.AbstractMediaQuery
All Implemented Interfaces:
MediaQuery, Serializable

public abstract class AbstractMediaQuery extends Object implements MediaQuery, Serializable
See Also:
  • Constructor Details

    • AbstractMediaQuery

      protected AbstractMediaQuery()
  • Method Details

    • isRangeFeature

      protected static boolean isRangeFeature(String string)
    • getCondition

      public BooleanCondition getCondition()
      Description copied from interface: MediaQuery
      The media feature conditions, if any.

      In this implementation, condition predicates implement MediaQueryPredicate and sub-interfaces.

      Specified by:
      getCondition in interface MediaQuery
      Returns:
      the media feature conditions, null otherwise.
    • getMedia

      public String getMedia()
      Description copied from interface: MediaQuery
      Get the serialized form of this media query.
      Specified by:
      getMedia in interface MediaQuery
      Returns:
      the serialized form of this media query.
    • getMediaType

      public String getMediaType()
      Description copied from interface: MediaQuery
      Get the media type, like screen or print.
      Specified by:
      getMediaType in interface MediaQuery
      Returns:
      the media type, null means all media.
    • getMinifiedMedia

      public String getMinifiedMedia()
      Description copied from interface: MediaQuery
      Get a minified serialized form of this media query.
      Specified by:
      getMinifiedMedia in interface MediaQuery
      Returns:
      the minified serialized form of this media query.
    • isAllMedia

      public boolean isAllMedia()
      Description copied from interface: MediaQuery
      Is this an all-media query?
      Specified by:
      isAllMedia in interface MediaQuery
      Returns:
      true if this query matches all media, false otherwise.
    • isNegated

      public boolean isNegated()
      Description copied from interface: MediaQuery
      Return true if this query is negated, like in not screen.
      Specified by:
      isNegated in interface MediaQuery
      Returns:
      true if this query is negated.
    • isNotAllMedia

      public boolean isNotAllMedia()
      Description copied from interface: MediaQuery
      Determine if this query evaluates to not all.
      Specified by:
      isNotAllMedia in interface MediaQuery
      Returns:
      true if this query matches no media, false otherwise.
    • matches

      protected boolean matches(AbstractMediaQuery other)
      Check whether the given query is partially or totaly contained by this one.

      If query A matches B, then if a medium matches B it will also match A. The opposite may not be true.

      Parameters:
      other - the other query to check against.
      Returns:
      true if the other query is partially or totally contained by this one.
    • matches

      protected abstract byte matches(BooleanCondition condition, BooleanCondition otherCondition, byte negatedQuery)
      Determine whether the two conditions match.
      Parameters:
      condition - the first condition.
      otherCondition - the second consdition.
      negatedQuery - 0 if it is a direct match, 1 if the this predicate is reverse (negated), 2 if the given predicate is negated, 3 if both are negated.
      Returns:
      1 if they match, 0 if don't, 2 if the match should not be taken into account.
    • matches

      public boolean matches(String medium, CSSCanvas canvas)
    • matchesPredicate

      protected abstract boolean matchesPredicate(BooleanCondition condition, CSSCanvas canvas)
    • setFeaturePredicate

      protected void setFeaturePredicate(BooleanCondition predicate)
    • setMediaType

      protected void setMediaType(String mediaType)
    • setNegative

      protected void setNegative(boolean negative)
    • setOnlyPrefix

      protected void setOnlyPrefix(boolean only)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object