public class PercentLength extends LengthProperty
LengthProperty.Maker
Constructor and Description |
---|
PercentLength(double factor,
PercentBase lbase)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
PercentBase |
getBaseLength() |
double |
getNumericValue()
Return the value of this Numeric
|
double |
getNumericValue(PercentBaseContext context)
Return the value of this Numeric
|
protected double |
getPercentage()
Used during property resolution to check for
negative percentages
|
java.lang.String |
getString()
This method expects to be overridden by subclasses.
|
int |
getValue()
Return the length of this PercentLength.
|
int |
getValue(PercentBaseContext context)
Returns the length in 1/1000ths of a point (millipoints)
|
boolean |
isAbsolute()
Return false because percent-length are always relative.
|
java.lang.String |
toString() |
getDimension, getLength, getNumeric, getObject
getCharacter, getColor, getCondLength, getEnum, getKeep, getLengthPair, getLengthRange, getList, getNCname, getNumber, getSpace, getSpecifiedValue, isAuto, setSpecifiedValue
public PercentLength(double factor, PercentBase lbase)
factor
- the percentage factor, expressed as a decimal (e.g. use
.95 to represent 95%)lbase
- base property to which the factor should be appliedpublic PercentBase getBaseLength()
protected double getPercentage()
public boolean isAbsolute()
public double getNumericValue()
public double getNumericValue(PercentBaseContext context)
context
- The context for the length calculation (for percentage based lengths)public java.lang.String getString()
public int getValue()
public int getValue(PercentBaseContext context)
context
- The context for the length calculation (for percentage based lengths)Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.