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.

### Field Summary

Fields
`static short` `SAC_ATTR` Attribute: `attr(...)`.
`static short` `SAC_CENTIMETER` Absolute length `cm`.
`static short` `SAC_COUNTER_FUNCTION` function `counter`.
`static short` `SAC_COUNTERS_FUNCTION` function `counters`.
`static short` `SAC_DEGREE` Angle `deg`.
`static short` `SAC_DIMENSION` unknown dimension.
`static short` `SAC_EM` Relative length`em`.
`static short` `SAC_EX` Relative length`ex`.
`static short` `SAC_FUNCTION` unknown function.
`static short` `SAC_GRADIAN` Angle `grad`.
`static short` `SAC_HERTZ` Frequency `Hz`.
`static short` `SAC_IDENT` any identifier except `inherit`.
`static short` `SAC_INCH` Absolute length `in`.
`static short` `SAC_INHERIT` identifier `inherit`.
`static short` `SAC_INTEGER` Integers.
`static short` `SAC_KILOHERTZ` Frequency `kHz`.
`static short` `SAC_MILLIMETER` Absolute length `mm`.
`static short` `SAC_MILLISECOND` Time `ms`.
`static short` `SAC_OPERATOR_COMMA` ,
`static short` `SAC_OPERATOR_EXP` ^
`static short` `SAC_OPERATOR_GE` >=
`static short` `SAC_OPERATOR_GT` >
`static short` `SAC_OPERATOR_LE` <=
`static short` `SAC_OPERATOR_LT` <
`static short` `SAC_OPERATOR_MINUS` -
`static short` `SAC_OPERATOR_MOD` %
`static short` `SAC_OPERATOR_MULTIPLY` *
`static short` `SAC_OPERATOR_PLUS` +
`static short` `SAC_OPERATOR_SLASH` /
`static short` `SAC_OPERATOR_TILDE` ~
`static short` `SAC_PERCENTAGE` Percentage.
`static short` `SAC_PICA` Absolute length `pc`.
`static short` `SAC_PIXEL` Relative length `px`.
`static short` `SAC_POINT` Absolute length `pt`.
`static short` `SAC_RADIAN` Angle `rad`.
`static short` `SAC_REAL` reals.
`static short` `SAC_RECT_FUNCTION` function `rect`.
`static short` `SAC_RGBCOLOR` RGB Colors.
`static short` `SAC_SECOND` Time `s`.
`static short` `SAC_STRING_VALUE` A string.
`static short` `SAC_SUB_EXPRESSION` sub expressions `(a)` `(a + b)` `(normal/none)`
`static short` `SAC_UNICODERANGE` A unicode range.
`static short` `SAC_URI` URI: `uri(...)`.

### Method Summary

Methods
`java.lang.String` `getDimensionUnitText()` Returns the string representation of the unit.
`float` `getFloatValue()` Returns the float value.
`java.lang.String` `getFunctionName()` Returns the name of the function.
`int` `getIntegerValue()` Returns the integer value.
`short` `getLexicalUnitType()` An integer indicating the type of `LexicalUnit`.
`LexicalUnit` `getNextLexicalUnit()` Returns the next value or `null` if any.
`LexicalUnit` `getParameters()` The function parameters including operators (like the comma).
`LexicalUnit` `getPreviousLexicalUnit()` Returns the previous value or `null` if any.
`java.lang.String` `getStringValue()` Returns the string value.
`LexicalUnit` `getSubValues()` Returns a list of values inside the sub expression.

### Field Detail

#### SAC_OPERATOR_COMMA

    static final short SAC_OPERATOR_COMMA

,

See Also:
  Constant Field Values

#### SAC_OPERATOR_PLUS

    static final short SAC_OPERATOR_PLUS

+

See Also:
  Constant Field Values

#### SAC_OPERATOR_MINUS

    static final short SAC_OPERATOR_MINUS

-

See Also:
  Constant Field Values

#### SAC_OPERATOR_MULTIPLY

    static final short SAC_OPERATOR_MULTIPLY

*

See Also:
  Constant Field Values

#### SAC_OPERATOR_SLASH

    static final short SAC_OPERATOR_SLASH

/

See Also:
  Constant Field Values

#### SAC_OPERATOR_MOD

    static final short SAC_OPERATOR_MOD

%

See Also:
  Constant Field Values

#### SAC_OPERATOR_EXP

    static final short SAC_OPERATOR_EXP

^

See Also:
  Constant Field Values

#### SAC_OPERATOR_LT

    static final short SAC_OPERATOR_LT

<

See Also:
  Constant Field Values

#### SAC_OPERATOR_GT

    static final short SAC_OPERATOR_GT

>

See Also:
  Constant Field Values

#### SAC_OPERATOR_LE

    static final short SAC_OPERATOR_LE

<=

See Also:
  Constant Field Values

#### SAC_OPERATOR_GE

    static final short SAC_OPERATOR_GE

>=

See Also:
  Constant Field Values

#### SAC_OPERATOR_TILDE

    static final short SAC_OPERATOR_TILDE

~

See Also:
  Constant Field Values

#### SAC_INHERIT

    static final short SAC_INHERIT

identifier `inherit`.

See Also:
  Constant Field Values

#### SAC_INTEGER

    static final short SAC_INTEGER

Integers.

See Also:
  `getIntegerValue()`, Constant Field Values

#### SAC_REAL

    static final short SAC_REAL

reals.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_EM

    static final short SAC_EM

Relative length`em`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_EX

    static final short SAC_EX

Relative length`ex`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_PIXEL

    static final short SAC_PIXEL

Relative length `px`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_INCH

    static final short SAC_INCH

Absolute length `in`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_CENTIMETER

    static final short SAC_CENTIMETER

Absolute length `cm`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_MILLIMETER

    static final short SAC_MILLIMETER

Absolute length `mm`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_POINT

    static final short SAC_POINT

Absolute length `pt`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_PICA

    static final short SAC_PICA

Absolute length `pc`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_PERCENTAGE

    static final short SAC_PERCENTAGE

Percentage.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_URI

    static final short SAC_URI

URI: `uri(...)`.

See Also:
  `getStringValue()`, Constant Field Values

#### SAC_COUNTER_FUNCTION

    static final short SAC_COUNTER_FUNCTION

function `counter`.

See Also:
  `getFunctionName()`, `getParameters()`, Constant Field Values

#### SAC_COUNTERS_FUNCTION

    static final short SAC_COUNTERS_FUNCTION

function `counters`.

See Also:
  `getFunctionName()`, `getParameters()`, Constant Field Values

#### SAC_RGBCOLOR

    static final short SAC_RGBCOLOR

RGB Colors. `rgb(0, 0, 0)` and `#000`

See Also:
  `getFunctionName()`, `getParameters()`, Constant Field Values

#### SAC_DEGREE

    static final short SAC_DEGREE

Angle `deg`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_GRADIAN

    static final short SAC_GRADIAN

Angle `grad`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_RADIAN

    static final short SAC_RADIAN

Angle `rad`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_MILLISECOND

    static final short SAC_MILLISECOND

Time `ms`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_SECOND

    static final short SAC_SECOND

Time `s`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_HERTZ

    static final short SAC_HERTZ

Frequency `Hz`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_KILOHERTZ

    static final short SAC_KILOHERTZ

Frequency `kHz`.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

#### SAC_IDENT

    static final short SAC_IDENT

any identifier except `inherit`.

See Also:
  `getStringValue()`, Constant Field Values

#### SAC_STRING_VALUE

    static final short SAC_STRING_VALUE

A string.

See Also:
  `getStringValue()`, Constant Field Values

#### SAC_ATTR

    static final short SAC_ATTR

Attribute: `attr(...)`.

See Also:
  `getStringValue()`, Constant Field Values

#### SAC_RECT_FUNCTION

    static final short SAC_RECT_FUNCTION

function `rect`.

See Also:
  `getFunctionName()`, `getParameters()`, Constant Field Values

#### SAC_UNICODERANGE

    static final short SAC_UNICODERANGE

A unicode range. @@TO BE DEFINED

See Also:
  Constant Field Values

#### SAC_SUB_EXPRESSION

    static final short SAC_SUB_EXPRESSION

sub expressions `(a)` `(a + b)` `(normal/none)`

See Also:
  `getSubValues()`, Constant Field Values

#### SAC_FUNCTION

    static final short SAC_FUNCTION

unknown function.

See Also:
  `getFunctionName()`, `getParameters()`, Constant Field Values

#### SAC_DIMENSION

    static final short SAC_DIMENSION

unknown dimension.

See Also:
  `getFloatValue()`, `getDimensionUnitText()`, Constant Field Values

### Method Detail

#### getLexicalUnitType

    short getLexicalUnitType()

An integer indicating the type of `LexicalUnit`.

#### getNextLexicalUnit

    LexicalUnit getNextLexicalUnit()

Returns the next value or `null` if any.

#### getPreviousLexicalUnit

    LexicalUnit getPreviousLexicalUnit()

Returns the previous value or `null` if any.

#### getIntegerValue

    int getIntegerValue()

Returns the integer value.

See Also:
  `SAC_INTEGER`

#### 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:
  `SAC_REAL`, `SAC_DIMENSION`, `SAC_EM`, `SAC_EX`, `SAC_PIXEL`, `SAC_INCH`, `SAC_CENTIMETER`, `SAC_MILLIMETER`, `SAC_POINT`, `SAC_PICA`, `SAC_PERCENTAGE`, `SAC_DEGREE`, `SAC_GRADIAN`, `SAC_RADIAN`, `SAC_MILLISECOND`, `SAC_SECOND`, `SAC_HERTZ`, `SAC_KILOHERTZ`

#### getDimensionUnitText

    java.lang.String getDimensionUnitText()

Returns the string representation of the unit.

if this lexical unit represents a float, the dimension is an empty string.

See Also:
  `SAC_REAL`, `SAC_DIMENSION`, `SAC_EM`, `SAC_EX`, `SAC_PIXEL`, `SAC_INCH`, `SAC_CENTIMETER`, `SAC_MILLIMETER`, `SAC_POINT`, `SAC_PICA`, `SAC_PERCENTAGE`, `SAC_DEGREE`, `SAC_GRADIAN`, `SAC_RADIAN`, `SAC_MILLISECOND`, `SAC_SECOND`, `SAC_HERTZ`, `SAC_KILOHERTZ`

#### getFunctionName

    java.lang.String getFunctionName()

Returns the name of the function.

See Also:
  `SAC_COUNTER_FUNCTION`, `SAC_COUNTERS_FUNCTION`, `SAC_RECT_FUNCTION`, `SAC_FUNCTION`, `SAC_RGBCOLOR`

#### getParameters

    LexicalUnit getParameters()

The function parameters including operators (like the comma). `#000` is converted to `rgb(0, 0, 0)` can return `null` if `SAC_FUNCTION`.

See Also:
  `SAC_COUNTER_FUNCTION`, `SAC_COUNTERS_FUNCTION`, `SAC_RECT_FUNCTION`, `SAC_FUNCTION`, `SAC_RGBCOLOR`

#### getStringValue

    java.lang.String getStringValue()

Returns the string value.

If the type is `SAC_URI`, the return value doesn't contain `uri(....)` or quotes.

If the type is `SAC_ATTR`, the return value doesn't contain `attr(....)`.

See Also:
  `SAC_URI`, `SAC_ATTR`, `SAC_IDENT`, `SAC_STRING_VALUE`, `@@TO BE DEFINED`

#### getSubValues

    LexicalUnit getSubValues()

Returns a list of values inside the sub expression.

See Also:
  `SAC_SUB_EXPRESSION`