Package org.w3c.css.sac
Interface LexicalUnit
public interface LexicalUnit
This is a lexical unit for CSS values.
Remarks: Not all the following lexical units are supported (or will be supported) by CSS.
All examples are CSS2 compliant.
- Version:
- $Revision: 477010 $
- Author:
- Philippe Le Hegaret
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final short
Attribute:attr(...)
.static final short
Absolute lengthcm
.static final short
functioncounter
.static final short
functioncounters
.static final short
Angledeg
.static final short
unknown dimension.static final short
Relative lengthem
.static final short
Relative lengthex
.static final short
unknown function.static final short
Anglegrad
.static final short
FrequencyHz
.static final short
any identifier exceptinherit
.static final short
Absolute lengthin
.static final short
identifierinherit
.static final short
Integers.static final short
FrequencykHz
.static final short
Absolute lengthmm
.static final short
Timems
.static final short
,static final short
^static final short
>=static final short
>static final short
invalid input: '<'=static final short
invalid input: '<'static final short
-static final short
%static final short
*static final short
+static final short
/static final short
~static final short
Percentage.static final short
Absolute lengthpc
.static final short
Relative lengthpx
.static final short
Absolute lengthpt
.static final short
Anglerad
.static final short
reals.static final short
functionrect
.static final short
RGB Colors.static final short
Times
.static final short
A string.static final short
sub expressions(a)
(a + b)
(normal/none)
static final short
A unicode range.static final short
URI:uri(...)
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the string representation of the unit.float
Returns the float value.Returns the name of the function.int
Returns the integer value.short
An integer indicating the type ofLexicalUnit
.Returns the next value ornull
if any.The function parameters including operators (like the comma).Returns the previous value ornull
if any.Returns the string value.Returns a list of values inside the sub expression.
-
Field Details
-
SAC_OPERATOR_COMMA
static final short SAC_OPERATOR_COMMA,- See Also:
-
SAC_OPERATOR_PLUS
static final short SAC_OPERATOR_PLUS+- See Also:
-
SAC_OPERATOR_MINUS
static final short SAC_OPERATOR_MINUS-- See Also:
-
SAC_OPERATOR_MULTIPLY
static final short SAC_OPERATOR_MULTIPLY*- See Also:
-
SAC_OPERATOR_SLASH
static final short SAC_OPERATOR_SLASH/- See Also:
-
SAC_OPERATOR_MOD
static final short SAC_OPERATOR_MOD%- See Also:
-
SAC_OPERATOR_EXP
static final short SAC_OPERATOR_EXP^- See Also:
-
SAC_OPERATOR_LT
static final short SAC_OPERATOR_LTinvalid input: '<'- See Also:
-
SAC_OPERATOR_GT
static final short SAC_OPERATOR_GT>- See Also:
-
SAC_OPERATOR_LE
static final short SAC_OPERATOR_LEinvalid input: '<'=- See Also:
-
SAC_OPERATOR_GE
static final short SAC_OPERATOR_GE>=- See Also:
-
SAC_OPERATOR_TILDE
static final short SAC_OPERATOR_TILDE~- See Also:
-
SAC_INHERIT
static final short SAC_INHERITidentifierinherit
.- See Also:
-
SAC_INTEGER
static final short SAC_INTEGERIntegers.- See Also:
-
SAC_REAL
static final short SAC_REALreals.- See Also:
-
SAC_EM
static final short SAC_EMRelative lengthem
.- See Also:
-
SAC_EX
static final short SAC_EXRelative lengthex
.- See Also:
-
SAC_PIXEL
static final short SAC_PIXELRelative lengthpx
.- See Also:
-
SAC_INCH
static final short SAC_INCHAbsolute lengthin
.- See Also:
-
SAC_CENTIMETER
static final short SAC_CENTIMETERAbsolute lengthcm
.- See Also:
-
SAC_MILLIMETER
static final short SAC_MILLIMETERAbsolute lengthmm
.- See Also:
-
SAC_POINT
static final short SAC_POINTAbsolute lengthpt
.- See Also:
-
SAC_PICA
static final short SAC_PICAAbsolute lengthpc
.- See Also:
-
SAC_PERCENTAGE
static final short SAC_PERCENTAGEPercentage.- See Also:
-
SAC_URI
static final short SAC_URIURI:uri(...)
.- See Also:
-
SAC_COUNTER_FUNCTION
static final short SAC_COUNTER_FUNCTIONfunctioncounter
.- See Also:
-
SAC_COUNTERS_FUNCTION
static final short SAC_COUNTERS_FUNCTIONfunctioncounters
.- See Also:
-
SAC_RGBCOLOR
static final short SAC_RGBCOLORRGB Colors.rgb(0, 0, 0)
and#000
- See Also:
-
SAC_DEGREE
static final short SAC_DEGREEAngledeg
.- See Also:
-
SAC_GRADIAN
static final short SAC_GRADIANAnglegrad
.- See Also:
-
SAC_RADIAN
static final short SAC_RADIANAnglerad
.- See Also:
-
SAC_MILLISECOND
static final short SAC_MILLISECONDTimems
.- See Also:
-
SAC_SECOND
static final short SAC_SECONDTimes
.- See Also:
-
SAC_HERTZ
static final short SAC_HERTZFrequencyHz
.- See Also:
-
SAC_KILOHERTZ
static final short SAC_KILOHERTZFrequencykHz
.- See Also:
-
SAC_IDENT
static final short SAC_IDENTany identifier exceptinherit
.- See Also:
-
SAC_STRING_VALUE
static final short SAC_STRING_VALUEA string.- See Also:
-
SAC_ATTR
static final short SAC_ATTRAttribute:attr(...)
.- See Also:
-
SAC_RECT_FUNCTION
static final short SAC_RECT_FUNCTIONfunctionrect
.- See Also:
-
SAC_UNICODERANGE
static final short SAC_UNICODERANGEA unicode range. @@TO BE DEFINED- See Also:
-
SAC_SUB_EXPRESSION
static final short SAC_SUB_EXPRESSIONsub expressions(a)
(a + b)
(normal/none)
- See Also:
-
SAC_FUNCTION
static final short SAC_FUNCTIONunknown function.- See Also:
-
SAC_DIMENSION
static final short SAC_DIMENSIONunknown dimension.- See Also:
-
-
Method Details
-
getLexicalUnitType
short getLexicalUnitType()An integer indicating the type ofLexicalUnit
. -
getNextLexicalUnit
LexicalUnit getNextLexicalUnit()Returns the next value ornull
if any. -
getPreviousLexicalUnit
LexicalUnit getPreviousLexicalUnit()Returns the previous value ornull
if any. -
getIntegerValue
int getIntegerValue()Returns the integer value.- See Also:
-
getFloatValue
float getFloatValue()Returns the float value.If the type of
LexicalUnit
is one of SAC_DEGREE, SAC_GRADIAN, SAC_RADIAN, SAC_MILLISECOND, SAC_SECOND, SAC_HERTZ or SAC_KILOHERTZ, the value can never be negative.- See Also:
-
getDimensionUnitText
String getDimensionUnitText()Returns the string representation of the unit.if this lexical unit represents a float, the dimension is an empty string.
- See Also:
-
getFunctionName
String getFunctionName()Returns the name of the function.- See Also:
-
getParameters
LexicalUnit getParameters()The function parameters including operators (like the comma).#000
is converted torgb(0, 0, 0)
can returnnull
ifSAC_FUNCTION
.- See Also:
-
getStringValue
String getStringValue()Returns the string value.If the type is
SAC_URI
, the return value doesn't containuri(....)
or quotes.If the type is
SAC_ATTR
, the return value doesn't containattr(....)
.- See Also:
-
getSubValues
LexicalUnit getSubValues()Returns a list of values inside the sub expression.- See Also:
-