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 shortAttribute:attr(...).static final shortAbsolute lengthcm.static final shortfunctioncounter.static final shortfunctioncounters.static final shortAngledeg.static final shortunknown dimension.static final shortRelative lengthem.static final shortRelative lengthex.static final shortunknown function.static final shortAnglegrad.static final shortFrequencyHz.static final shortany identifier exceptinherit.static final shortAbsolute lengthin.static final shortidentifierinherit.static final shortIntegers.static final shortFrequencykHz.static final shortAbsolute lengthmm.static final shortTimems.static final short,static final short^static final short>=static final short>static final shortinvalid input: '<'=static final shortinvalid input: '<'static final short-static final short%static final short*static final short+static final short/static final short~static final shortPercentage.static final shortAbsolute lengthpc.static final shortRelative lengthpx.static final shortAbsolute lengthpt.static final shortAnglerad.static final shortreals.static final shortfunctionrect.static final shortRGB Colors.static final shortTimes.static final shortA string.static final shortsub expressions(a)(a + b)(normal/none)static final shortA unicode range.static final shortURI:uri(...). -
Method Summary
Modifier and TypeMethodDescriptionReturns the string representation of the unit.floatReturns the float value.Returns the name of the function.intReturns the integer value.shortAn integer indicating the type ofLexicalUnit.Returns the next value ornullif any.The function parameters including operators (like the comma).Returns the previous value ornullif 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 ornullif any. -
getPreviousLexicalUnit
LexicalUnit getPreviousLexicalUnit()Returns the previous value ornullif any. -
getIntegerValue
int getIntegerValue()Returns the integer value.- See Also:
-
getFloatValue
float getFloatValue()Returns the float value.If the type of
LexicalUnitis 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
-
getParameters
LexicalUnit getParameters()The function parameters including operators (like the comma).#000is converted torgb(0, 0, 0)can returnnullifSAC_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
-