Package org.htmlunit.cssparser.parser
Class LexicalUnitImpl
java.lang.Object
org.htmlunit.cssparser.parser.AbstractLocatable
org.htmlunit.cssparser.parser.LexicalUnitImpl
- All Implemented Interfaces:
Serializable,LexicalUnit,Locatable
Implementation of
LexicalUnit.- Author:
- Ronald Brill
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.htmlunit.cssparser.parser.LexicalUnit
LexicalUnit.LexicalUnitType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLexicalUnitImpl(LexicalUnit previous, int value) Integer.LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type) Ctor.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, double value) Dimension.LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String value) String.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String dimension, double value) Unknown dimension.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, String stringValue) Function.protectedLexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, LexicalUnit params) Function. -
Method Summary
Modifier and TypeMethodDescriptionstatic LexicalUnitcreateAttr(LexicalUnit prev, String value) static LexicalUnitcreateCalc(LexicalUnit prev, LexicalUnit params) static LexicalUnitcreateCentimeter(LexicalUnit prev, double d) static LexicalUnitcreateCh(LexicalUnit prev, double d) static LexicalUnitcreateComma(LexicalUnit prev) static LexicalUnitcreateCounter(LexicalUnit prev, LexicalUnit params) static LexicalUnitcreateCounters(LexicalUnit prev, LexicalUnit params) static LexicalUnitcreateDegree(LexicalUnit prev, double d) static LexicalUnitcreateDimension(LexicalUnit prev, double d, String dim) static LexicalUnitcreateDivide(LexicalUnit prev) static LexicalUnitcreateEm(LexicalUnit prev, double d) static LexicalUnitcreateEx(LexicalUnit prev, double d) static LexicalUnitcreateFrom(LexicalUnit prev) static LexicalUnitcreateFunction(LexicalUnit prev, String name, LexicalUnit params) static LexicalUnitcreateGradian(LexicalUnit prev, double d) static LexicalUnitcreateHertz(LexicalUnit prev, double d) static LexicalUnitcreateHslColor(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnitcreateHwbColor(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnitcreateIdent(LexicalUnit prev, String value) static LexicalUnitcreateInch(LexicalUnit prev, double d) static LexicalUnitcreateInherit(LexicalUnit prev) static LexicalUnitcreateKiloHertz(LexicalUnit prev, double d) static LexicalUnitcreateLabColor(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnitcreateLchColor(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnitcreateMillimeter(LexicalUnit prev, double d) static LexicalUnitcreateMillisecond(LexicalUnit prev, double d) static LexicalUnitcreateMinus(LexicalUnit prev) static LexicalUnitcreateMultiply(LexicalUnit prev) static LexicalUnitcreateNone(LexicalUnit prev) static LexicalUnitcreateNumber(LexicalUnit prev, double d) static LexicalUnitcreateNumber(LexicalUnit prev, int i) static LexicalUnitcreatePercentage(LexicalUnit prev, double d) static LexicalUnitcreatePica(LexicalUnit prev, double d) static LexicalUnitcreatePixel(LexicalUnit prev, double d) static LexicalUnitcreatePlus(LexicalUnit prev) static LexicalUnitcreatePoint(LexicalUnit prev, double d) static LexicalUnitcreateQuater(LexicalUnit prev, double d) static LexicalUnitcreateRadian(LexicalUnit prev, double d) static LexicalUnitcreateRect(LexicalUnit prev, LexicalUnit params) static LexicalUnitcreateRem(LexicalUnit prev, double d) static LexicalUnitcreateRgbColor(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnitcreateSecond(LexicalUnit prev, double d) static LexicalUnitcreateSlash(LexicalUnit prev) static LexicalUnitcreateString(LexicalUnit prev, String value) static LexicalUnitcreateTurn(LexicalUnit prev, double d) static LexicalUnitcreateURI(LexicalUnit prev, String value) static LexicalUnitcreateVh(LexicalUnit prev, double d) static LexicalUnitcreateVMax(LexicalUnit prev, double d) static LexicalUnitcreateVMin(LexicalUnit prev, double d) static LexicalUnitcreateVw(LexicalUnit prev, double d) getDimensionUnitText.doublegetDoubleValue.getFunctionName.intgetIntegerValue.getLexicalUnitType.getNextLexicalUnit.getParameters.getPreviousLexicalUnit.getStringValue.getSubValues.voidsetDimension(String dimension) voidsetDoubleValue(double doubleVal) voidsetFunctionName(String function) voidvoidsetParameters(LexicalUnit params) voidvoidsetStringValue(String stringVal) toString()Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocatorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.htmlunit.cssparser.parser.LexicalUnit
getLocator, setLocator
-
Constructor Details
-
LexicalUnitImpl
Ctor.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitType
-
LexicalUnitImpl
Integer.- Parameters:
previous- the previous LexicalUnitvalue- the int value
-
LexicalUnitImpl
Dimension.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypevalue- the double value
-
LexicalUnitImpl
protected LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String dimension, double value) Unknown dimension.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypedimension- the dimensionvalue- the double value
-
LexicalUnitImpl
String.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypevalue- the string value
-
LexicalUnitImpl
protected LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, LexicalUnit params) Function.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypename- the nameparams- the parameter LexicalUnit
-
LexicalUnitImpl
protected LexicalUnitImpl(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, String stringValue) Function.- Parameters:
previous- the previous LexicalUnittype- the LexicalUnitTypename- the namestringValue- the string value
-
-
Method Details
-
setNextLexicalUnit
- Parameters:
next- next LexicalUnit
-
setPreviousLexicalUnit
- Parameters:
prev- previous LexicalUnit
-
setDoubleValue
public void setDoubleValue(double doubleVal) - Parameters:
doubleVal- the double value
-
getDimension
- Returns:
- the dimension
-
setDimension
- Parameters:
dimension- the new dimension
-
setFunctionName
- Parameters:
function- the function name
-
setParameters
- Parameters:
params- the parameter LexicalUnit
-
setStringValue
- Parameters:
stringVal- the string value
-
getLexicalUnitType
Description copied from interface:LexicalUnitgetLexicalUnitType.
- Specified by:
getLexicalUnitTypein interfaceLexicalUnit- Returns:
- an integer indicating the type of
LexicalUnit.
-
getNextLexicalUnit
Description copied from interface:LexicalUnitgetNextLexicalUnit.
- Specified by:
getNextLexicalUnitin interfaceLexicalUnit- Returns:
- the next value or
nullif any.
-
getPreviousLexicalUnit
Description copied from interface:LexicalUnitgetPreviousLexicalUnit.
- Specified by:
getPreviousLexicalUnitin interfaceLexicalUnit- Returns:
- the previous value or
nullif any.
-
getIntegerValue
public int getIntegerValue()Description copied from interface:LexicalUnitgetIntegerValue.
- Specified by:
getIntegerValuein interfaceLexicalUnit- Returns:
- the integer value.
-
getDoubleValue
public double getDoubleValue()Description copied from interface:LexicalUnitgetDoubleValue.
- Specified by:
getDoubleValuein interfaceLexicalUnit- Returns:
- the double value.
-
getDimensionUnitText
Description copied from interface:LexicalUnitgetDimensionUnitText.
- Specified by:
getDimensionUnitTextin interfaceLexicalUnit- Returns:
- the string representation of the unit.
-
getFunctionName
Description copied from interface:LexicalUnitgetFunctionName.
- Specified by:
getFunctionNamein interfaceLexicalUnit- Returns:
- the name of the function.
-
getParameters
Description copied from interface:LexicalUnitgetParameters.
- Specified by:
getParametersin interfaceLexicalUnit- Returns:
- the function parameters including operators (like the comma).
-
getStringValue
Description copied from interface:LexicalUnitgetStringValue.
- Specified by:
getStringValuein interfaceLexicalUnit- Returns:
- the string value.
-
getSubValues
Description copied from interface:LexicalUnitgetSubValues.
- Specified by:
getSubValuesin interfaceLexicalUnit- Returns:
- a list of values inside the sub expression.
-
getCssText
- Returns:
- the current css text
-
toString
-
toDebugString
- Returns:
- a string helping to debug
-
createNumber
- Parameters:
prev- the previous LexicalUniti- the integer value- Returns:
- lexical unit with type integer
-
createNumber
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type real
-
createPercentage
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type percent
-
createPixel
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type pixel
-
createCentimeter
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type centimeter
-
createMillimeter
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type millimeter
-
createInch
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type inch
-
createPoint
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type point
-
createPica
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type pica
-
createQuater
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type quater
-
createEm
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type em
-
createRem
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type rem
-
createEx
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type ex
-
createCh
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type ch
-
createVw
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vw
-
createVh
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vh
-
createVMin
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vmin
-
createVMax
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type vmax
-
createDegree
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type degree
-
createRadian
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type radian
-
createGradian
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type gradian
-
createTurn
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type turn
-
createMillisecond
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type millisecond
-
createSecond
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type second
-
createHertz
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type hertz
-
createDimension
- Parameters:
prev- the previous LexicalUnitd- the double valuedim- the dimension- Returns:
- lexical unit with type dimension
-
createKiloHertz
- Parameters:
prev- the previous LexicalUnitd- the double value- Returns:
- lexical unit with type kilohertz
-
createCounter
- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type counter
-
createCounters
- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type counters
-
createAttr
- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type attr
-
createRect
- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type rect
-
createRgbColor
- Parameters:
prev- the previous LexicalUnitfunct- the name rgb or rgbaparams- the params- Returns:
- lexical unit with type rgb color
-
createHslColor
- Parameters:
prev- the previous LexicalUnitfunct- the name hsl or hslaparams- the params- Returns:
- lexical unit with type hsl color
-
createHwbColor
- Parameters:
prev- the previous LexicalUnitfunct- the name hwbparams- the params- Returns:
- lexical unit with type hwb color
-
createLabColor
- Parameters:
prev- the previous LexicalUnitfunct- the name labparams- the params- Returns:
- lexical unit with type lab color
-
createLchColor
- Parameters:
prev- the previous LexicalUnitfunct- the name lchparams- the params- Returns:
- lexical unit with type lch color
-
createNone
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type rgb color
-
createFrom
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type rgb color
-
createCalc
- Parameters:
prev- the previous LexicalUnitparams- the params- Returns:
- lexical unit with type calc
-
createFunction
- Parameters:
prev- the previous LexicalUnitname- the nameparams- the params- Returns:
- lexical unit with type function
-
createString
- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type string
-
createIdent
- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type ident
-
createURI
- Parameters:
prev- the previous LexicalUnitvalue- the value- Returns:
- lexical unit with type uri
-
createComma
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type comma
-
createInherit
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type comma
-
createSlash
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type slash
-
createPlus
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type plus
-
createMinus
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type minus
-
createMultiply
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type multiply
-
createDivide
- Parameters:
prev- the previous LexicalUnit- Returns:
- lexical unit with type slash
-