public class PercentLength extends LengthProperty
LengthProperty.Maker
Constructor and Description |
---|
PercentLength(double factor,
PercentBase lbase)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
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
|
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)
|
int |
hashCode() |
boolean |
isAbsolute()
Return false because percent-length are always relative.
|
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 String getString()
public int getValue()
public int getValue(PercentBaseContext context)
context
- The context for the length calculation (for percentage based lengths)Copyright © 2025 Apache Software Foundation. All rights reserved.