java.lang.Object
io.sf.carte.doc.style.css.parser.AbstractMediaQuery
- All Implemented Interfaces:
MediaQuery
,Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
The media feature conditions, if any.getMedia()
Get the serialized form of this media query.Get the media type, likescreen
orprint
.Get a minified serialized form of this media query.int
hashCode()
boolean
Is this an all-media query?boolean
Returntrue
if this query is negated, like innot screen
.boolean
Determine if this query evaluates tonot all
.protected static boolean
isRangeFeature
(String string) protected abstract byte
matches
(BooleanCondition condition, BooleanCondition otherCondition, byte negatedQuery) Determine whether the two conditions match.protected boolean
matches
(AbstractMediaQuery other) Check whether the given query is partially or totaly contained by this one.boolean
protected abstract boolean
matchesPredicate
(BooleanCondition condition, CSSCanvas canvas) protected void
setFeaturePredicate
(BooleanCondition predicate) protected void
setMediaType
(String mediaType) protected void
setNegative
(boolean negative) protected void
setOnlyPrefix
(boolean only) toString()
-
Constructor Details
-
AbstractMediaQuery
protected AbstractMediaQuery()
-
-
Method Details
-
isRangeFeature
-
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 interfaceMediaQuery
- Returns:
- the media feature conditions,
null
otherwise.
-
getMedia
Description copied from interface:MediaQuery
Get the serialized form of this media query.- Specified by:
getMedia
in interfaceMediaQuery
- Returns:
- the serialized form of this media query.
-
getMediaType
Description copied from interface:MediaQuery
Get the media type, likescreen
orprint
.- Specified by:
getMediaType
in interfaceMediaQuery
- Returns:
- the media type,
null
means all media.
-
getMinifiedMedia
Description copied from interface:MediaQuery
Get a minified serialized form of this media query.- Specified by:
getMinifiedMedia
in interfaceMediaQuery
- 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 interfaceMediaQuery
- Returns:
true
if this query matches all media,false
otherwise.
-
isNegated
public boolean isNegated()Description copied from interface:MediaQuery
Returntrue
if this query is negated, like innot screen
.- Specified by:
isNegated
in interfaceMediaQuery
- Returns:
true
if this query is negated.
-
isNotAllMedia
public boolean isNotAllMedia()Description copied from interface:MediaQuery
Determine if this query evaluates tonot all
.- Specified by:
isNotAllMedia
in interfaceMediaQuery
- Returns:
true
if this query matches no media,false
otherwise.
-
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:
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
-
matchesPredicate
-
setFeaturePredicate
-
setMediaType
-
setNegative
protected void setNegative(boolean negative) -
setOnlyPrefix
protected void setOnlyPrefix(boolean only) -
equals
-
hashCode
public int hashCode() -
toString
-