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 LexicalUnit
LexicalUnit.LexicalUnitType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate doubleprivate Stringprivate final LexicalUnit.LexicalUnitTypeprivate LexicalUnitprivate LexicalUnitprivate LexicalUnitprivate Stringprivate Stringcache -
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 TypeMethodDescriptionprivate voidstatic 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 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 LexicalUnitcreateIdent(LexicalUnit prev, String value) static LexicalUnitcreateInch(LexicalUnit prev, double d) static LexicalUnitcreateKiloHertz(LexicalUnit prev, double d) static LexicalUnitcreateMillimeter(LexicalUnit prev, double d) static LexicalUnitcreateMillisecond(LexicalUnit prev, double d) static LexicalUnitcreateMinus(LexicalUnit prev) static LexicalUnitcreateMultiply(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) doubleintprivate StringvoidsetDimension(String dimension) voidsetDoubleValue(double doubleVal) voidsetFunctionName(String function) voidvoidsetParameters(LexicalUnit params) voidvoidsetStringValue(String stringVal) toString()Methods inherited from class AbstractLocatable
getLocator, setLocatorMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:
getLexicalUnitTypein interfaceLexicalUnit- Returns:
- an integer indicating the type of
LexicalUnit.
-
getNextLexicalUnit
- Specified by:
getNextLexicalUnitin interfaceLexicalUnit- Returns:
- the next value or
nullif any.
-
getPreviousLexicalUnit
- Specified by:
getPreviousLexicalUnitin interfaceLexicalUnit- Returns:
- the previous value or
nullif any.
-
getIntegerValue
public int getIntegerValue()- Specified by:
getIntegerValuein interfaceLexicalUnit- Returns:
- the integer value.
-
getDoubleValue
public double getDoubleValue()- Specified by:
getDoubleValuein interfaceLexicalUnit- Returns:
- the double value.
-
getDimensionUnitText
- Specified by:
getDimensionUnitTextin interfaceLexicalUnit- Returns:
- the string representation of the unit.
-
getFunctionName
- Specified by:
getFunctionNamein interfaceLexicalUnit- Returns:
- the name of the function.
-
getParameters
- Specified by:
getParametersin interfaceLexicalUnit- Returns:
- the function parameters including operators (like the comma).
-
getStringValue
- Specified by:
getStringValuein interfaceLexicalUnit- Returns:
- the string value.
-
getSubValues
- 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
-
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
-