Package io.sf.carte.doc.style.css.parser
Class AbstractMediaQuery
java.lang.Object
io.sf.carte.doc.style.css.parser.AbstractMediaQuery
- All Implemented Interfaces:
MediaQuery,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe media feature conditions, if any.getMedia()Get the serialized form of this media query.Get the media type, likescreenorprint.Get a minified serialized form of this media query.inthashCode()booleanIs this an all-media query?booleanReturntrueif this query is negated, like innot screen.booleanDetermine if this query evaluates tonot all.protected static booleanisRangeFeature(String string) protected abstract bytematches(BooleanCondition condition, BooleanCondition otherCondition, byte negatedQuery) Determine whether the two conditions match.protected booleanmatches(AbstractMediaQuery other) Check whether the given query is partially or totaly contained by this one.booleanprotected abstract booleanmatchesPredicate(BooleanCondition condition, CSSCanvas canvas) protected voidsetFeaturePredicate(BooleanCondition predicate) protected voidsetMediaType(String mediaType) protected voidsetNegative(boolean negative) protected voidsetOnlyPrefix(boolean only) toString()
-
Constructor Details
-
AbstractMediaQuery
protected AbstractMediaQuery()
-
-
Method Details
-
isRangeFeature
-
getCondition
Description copied from interface:MediaQueryThe media feature conditions, if any.In this implementation, condition predicates implement
MediaQueryPredicateand sub-interfaces.- Specified by:
getConditionin interfaceMediaQuery- Returns:
- the media feature conditions,
nullotherwise.
-
getMedia
Description copied from interface:MediaQueryGet the serialized form of this media query.- Specified by:
getMediain interfaceMediaQuery- Returns:
- the serialized form of this media query.
-
getMediaType
Description copied from interface:MediaQueryGet the media type, likescreenorprint.- Specified by:
getMediaTypein interfaceMediaQuery- Returns:
- the media type,
nullmeans all media.
-
getMinifiedMedia
Description copied from interface:MediaQueryGet a minified serialized form of this media query.- Specified by:
getMinifiedMediain interfaceMediaQuery- Returns:
- the minified serialized form of this media query.
-
isAllMedia
public boolean isAllMedia()Description copied from interface:MediaQueryIs this an all-media query?- Specified by:
isAllMediain interfaceMediaQuery- Returns:
trueif this query matches all media,falseotherwise.
-
isNegated
public boolean isNegated()Description copied from interface:MediaQueryReturntrueif this query is negated, like innot screen.- Specified by:
isNegatedin interfaceMediaQuery- Returns:
trueif this query is negated.
-
isNotAllMedia
public boolean isNotAllMedia()Description copied from interface:MediaQueryDetermine if this query evaluates tonot all.- Specified by:
isNotAllMediain interfaceMediaQuery- Returns:
trueif this query matches no media,falseotherwise.
-
matches
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:
trueif 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-0if it is a direct match,1if the this predicate is reverse (negated),2if the given predicate is negated,3if both are negated.- Returns:
1if they match,0if don't,2if the match should not be taken into account.
-
matches
-
matchesPredicate
-
setFeaturePredicate
-
setMediaType
-
setNegative
protected void setNegative(boolean negative) -
setOnlyPrefix
protected void setOnlyPrefix(boolean only) -
equals
-
hashCode
public int hashCode() -
toString
-