org.foray.fotree.value
Interface PropertyValue

All Known Implementing Classes:
AxslPropertyKeyword, Datatype, DtAngle, DtBorderStyle, DtBorderWidth, DtCharacter, DtColor, DtCountry, DtFrequency, DtInteger, DtKeep, DtLanguage, DtLength, DtLengthBPIPDirection, DtLengthConditional, DtLengthRange, DtName, DtNumber, DtPercentage, DtRectangle, DtScript, DtShadowEffect, DtShape, DtSpace, DtString, DtTextDeco, DtTime, DtURI, DtWritingMode, Expr, ExprAdditive, ExprAdditiveOper, ExprInner, ExprMultiplicative, ExprMultiplicativeOper, ExprPrimary, ExprUnary, ExprUnaryOper, FnAbs, FnAbstractNamedProperty, FnBodyStart, FnCeiling, FnFloor, FnFromPageMasterRegion, FnFromParent, FnFromTableColumn, FnInheritedProp, FnLabelEnd, FnMax, FnMergePropertyValues, FnMin, FnNearestSpecProp, FnProportionalColWidth, FnRgb, FnRgbIcc, FnRound, FnSystemColor, FnSystemFont, FoPropertyKeyword, Function, PropertyCollection, PropertyValueStatic, PvKeyword, ValueCollection

public interface PropertyValue

Interface for all XSL-FO property values.


Method Summary
 boolean canEvalColor()
          Indicates whether this property value has the ability to express itself as a Color.
 boolean canEvalInteger()
          Indicates whether this property value has the ability to express itself as an integer Numeric item.
 boolean canEvalKeyword()
          Indicates whether this property value can evaluate to a keyword.
 boolean canEvalLength()
          Indicates whether this expression can be evaluated to a unit power = 1 (length) or not.
 boolean canEvalNumeric()
          Indicates whether this property value has the ability to express itself as a Numeric item.
 boolean canEvalPercentage()
          Indicates whether this property value can evaluate to a percentage.
 Color evalColor()
          Return the color value of "this".
 int evalInteger()
          Return this value as an int.
 PvKeyword evalKeyword()
          Returns the keyword value of this property value.
 int evalLength(int fontSize)
          Evaluates the expression to a unit power of 1 (length).
 double evalNumeric()
          Return the raw numeric value of "this", without regard to unit power.
 float evalPercentage()
          Returns the percentage value of this property value.
 byte getUnitPower()
          Each numeric has a "unit power".
 boolean lengthRequiresFontSize()
          Indicates whether the computation of the length will require an accurate font-size parameter.
 

Method Detail

canEvalNumeric

boolean canEvalNumeric()
Indicates whether this property value has the ability to express itself as a Numeric item.

Returns:
True iff this property value is a numeric.

evalNumeric

double evalNumeric()
Return the raw numeric value of "this", without regard to unit power.

Returns:
A double representation of the value of "this". Type "double" is assumed to be the lowest-common-denominator of all numeric values.

canEvalInteger

boolean canEvalInteger()
Indicates whether this property value has the ability to express itself as an integer Numeric item.

Returns:
True iff this property value is an integer.

evalInteger

int evalInteger()
Return this value as an int. This method should only be executed on instances where canEvalInteger() returns true. Doing so on other instances may result in an IllegalStateException.

Returns:
This value as an int.

getUnitPower

byte getUnitPower()
Each numeric has a "unit power". This number refers to the number of spatial dimensions in which the number operates. So, a number that has no relationship to space or refers to a point, has a length power of 0. A number that refers to length has a length power of 1 (1 dimension). Although there are none yet in XSL-FO, a number that referred to area (e.g. square inches) would, we suppose, have a length power of 2, and one referring to volume (e.g. cubic feet) would, we suppose have a length power of 3.

Returns:
The number of spatial dimensions in which this numeric item operates. For XSL-FO items, this should be either Expr.UNIT_POWER_NUMERIC or Expr.UNIT_POWER_LENGTH.

canEvalLength

boolean canEvalLength()
Indicates whether this expression can be evaluated to a unit power = 1 (length) or not.

Returns:
True if the expression can be evaluated to a unit power of 1 (length).

evalLength

int evalLength(int fontSize)
Evaluates the expression to a unit power of 1 (length).

Parameters:
fontSize - The point size, in millipoints, of the font. This is used in calculations that are relative to the point size. In cases where the computation of the font-size is expensive, check lengthRequiresFontSize() first. If that method returns false, zero or some other constant can safely be passed, as it will be ignored anyway.
Returns:
The unit power 1 value (length) of this expression if the expression can be so evaluated, or Integer.MIN_VALUE otherwise. The value is expressed in millipoints.

lengthRequiresFontSize

boolean lengthRequiresFontSize()
Indicates whether the computation of the length will require an accurate font-size parameter.

Returns:
True iff the computation of the length will require an accurate font-size parameter.

canEvalPercentage

boolean canEvalPercentage()
Indicates whether this property value can evaluate to a percentage.

Returns:
True iff this property value can evaluate to a percentage.

evalPercentage

float evalPercentage()
Returns the percentage value of this property value. This method should only be executed on instances where canEvalPercentage() returns true. Doing so on other instances may result in an IllegalStateException.

Returns:
The percentage value of this property value.

canEvalColor

boolean canEvalColor()
Indicates whether this property value has the ability to express itself as a Color.

Returns:
True iff this property value is a color.

evalColor

Color evalColor()
Return the color value of "this".

Returns:
The color representation of the value of "this".

canEvalKeyword

boolean canEvalKeyword()
Indicates whether this property value can evaluate to a keyword.

Returns:
True iff this property value can evaluate to a keyword.

evalKeyword

PvKeyword evalKeyword()
Returns the keyword value of this property value. This method should only be executed on instances where canEvalKeyword() returns true. Doing so on other instances may result in an IllegalStateException.

Returns:
The keyword value of this property value.


Copyright © 2017. All rights reserved.