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
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.htmlunit.cssparser.parser.LexicalUnit
LexicalUnit.LexicalUnitType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private double
private String
private final LexicalUnit.LexicalUnitType
private LexicalUnit
private LexicalUnit
private LexicalUnit
private String
private String
cache -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LexicalUnitImpl
(LexicalUnit previous, int value) Integer.LexicalUnitImpl
(LexicalUnit previous, LexicalUnit.LexicalUnitType type) Ctor.protected
LexicalUnitImpl
(LexicalUnit previous, LexicalUnit.LexicalUnitType type, double value) Dimension.LexicalUnitImpl
(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String value) String.protected
LexicalUnitImpl
(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String dimension, double value) Unknown dimension.protected
LexicalUnitImpl
(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, String stringValue) Function.protected
LexicalUnitImpl
(LexicalUnit previous, LexicalUnit.LexicalUnitType type, String name, LexicalUnit params) Function. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
static LexicalUnit
createAttr
(LexicalUnit prev, String value) static LexicalUnit
createCalc
(LexicalUnit prev, LexicalUnit params) static LexicalUnit
createCentimeter
(LexicalUnit prev, double d) static LexicalUnit
createCh
(LexicalUnit prev, double d) static LexicalUnit
createComma
(LexicalUnit prev) static LexicalUnit
createCounter
(LexicalUnit prev, LexicalUnit params) static LexicalUnit
createCounters
(LexicalUnit prev, LexicalUnit params) static LexicalUnit
createDegree
(LexicalUnit prev, double d) static LexicalUnit
createDimension
(LexicalUnit prev, double d, String dim) static LexicalUnit
createDivide
(LexicalUnit prev) static LexicalUnit
createEm
(LexicalUnit prev, double d) static LexicalUnit
createEx
(LexicalUnit prev, double d) static LexicalUnit
createFunction
(LexicalUnit prev, String name, LexicalUnit params) static LexicalUnit
createGradian
(LexicalUnit prev, double d) static LexicalUnit
createHertz
(LexicalUnit prev, double d) static LexicalUnit
createHslColor
(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnit
createIdent
(LexicalUnit prev, String value) static LexicalUnit
createInch
(LexicalUnit prev, double d) static LexicalUnit
createKiloHertz
(LexicalUnit prev, double d) static LexicalUnit
createMillimeter
(LexicalUnit prev, double d) static LexicalUnit
createMillisecond
(LexicalUnit prev, double d) static LexicalUnit
createMinus
(LexicalUnit prev) static LexicalUnit
createMultiply
(LexicalUnit prev) static LexicalUnit
createNumber
(LexicalUnit prev, double d) static LexicalUnit
createNumber
(LexicalUnit prev, int i) static LexicalUnit
createPercentage
(LexicalUnit prev, double d) static LexicalUnit
createPica
(LexicalUnit prev, double d) static LexicalUnit
createPixel
(LexicalUnit prev, double d) static LexicalUnit
createPlus
(LexicalUnit prev) static LexicalUnit
createPoint
(LexicalUnit prev, double d) static LexicalUnit
createQuater
(LexicalUnit prev, double d) static LexicalUnit
createRadian
(LexicalUnit prev, double d) static LexicalUnit
createRect
(LexicalUnit prev, LexicalUnit params) static LexicalUnit
createRem
(LexicalUnit prev, double d) static LexicalUnit
createRgbColor
(LexicalUnit prev, String funct, LexicalUnit params) static LexicalUnit
createSecond
(LexicalUnit prev, double d) static LexicalUnit
createSlash
(LexicalUnit prev) static LexicalUnit
createString
(LexicalUnit prev, String value) static LexicalUnit
createTurn
(LexicalUnit prev, double d) static LexicalUnit
createURI
(LexicalUnit prev, String value) static LexicalUnit
createVh
(LexicalUnit prev, double d) static LexicalUnit
createVMax
(LexicalUnit prev, double d) static LexicalUnit
createVMin
(LexicalUnit prev, double d) static LexicalUnit
createVw
(LexicalUnit prev, double d) double
int
private String
void
setDimension
(String dimension) void
setDoubleValue
(double doubleVal) void
setFunctionName
(String function) void
void
setParameters
(LexicalUnit params) void
void
setStringValue
(String stringVal) toString()
Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.htmlunit.cssparser.parser.LexicalUnit
getLocator, setLocator
-
Field Details
-
lexicalUnitType_
-
nextLexicalUnit_
-
previousLexicalUnit_
-
doubleValue_
private double doubleValue_ -
dimension_
-
functionName_
-
parameters_
-
stringValue_
-
toString_
cache
-
-
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
- Specified by:
getLexicalUnitType
in interfaceLexicalUnit
- Returns:
- an integer indicating the type of
LexicalUnit
.
-
getNextLexicalUnit
- Specified by:
getNextLexicalUnit
in interfaceLexicalUnit
- Returns:
- the next value or
null
if any.
-
getPreviousLexicalUnit
- Specified by:
getPreviousLexicalUnit
in interfaceLexicalUnit
- Returns:
- the previous value or
null
if any.
-
getIntegerValue
public int getIntegerValue()- Specified by:
getIntegerValue
in interfaceLexicalUnit
- Returns:
- the integer value.
-
getDoubleValue
public double getDoubleValue()- Specified by:
getDoubleValue
in interfaceLexicalUnit
- Returns:
- the double value.
-
getDimensionUnitText
- Specified by:
getDimensionUnitText
in interfaceLexicalUnit
- Returns:
- the string representation of the unit.
-
getFunctionName
- Specified by:
getFunctionName
in interfaceLexicalUnit
- Returns:
- the name of the function.
-
getParameters
- Specified by:
getParameters
in interfaceLexicalUnit
- Returns:
- the function parameters including operators (like the comma).
-
getStringValue
- Specified by:
getStringValue
in interfaceLexicalUnit
- Returns:
- the string value.
-
getSubValues
- Specified by:
getSubValues
in interfaceLexicalUnit
- Returns:
- a list of values inside the sub expression.
-
getCssText
- Returns:
- the current css text
-
toString
-
toDebugString
- Returns:
- a string helping to debug
-
appendParams
-
getTrimedDoubleValue
-
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 rgb or rgbaparams
- the params- 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
-
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
-