|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.fop.fo.expr.Numeric
Represents a "numeric" value as defined by the XSL FO Specification. This consists of one or more kinds of value specifications, from absolute numbers (units power of 0) to lengths (unit power of 1), relative lengths (ems), percentage lengths. A Numeric can be constructed from other Property types representing Numbers or Length-type values. Numeric provides methods to return Number and Length values based on its current value. It supports basic arithmetic operations involving Numerics.
Field Summary | |
static int |
ABS_LENGTH
|
static int |
PC_LENGTH
|
static int |
TCOL_LENGTH
|
Constructor Summary | |
protected |
Numeric(int valType,
double absValue,
double pcValue,
double tcolValue,
int dim,
PercentBase pcBase)
Construct a Numeric object by specifying one or more components, including absolute length, percent length, table units. |
|
Numeric(Length l)
Construct a Numeric object from a Length. |
|
Numeric(java.lang.Number num)
Construct a Numeric object from a Number. |
|
Numeric(PercentLength pclen)
Construct a Numeric object from a PercentLength. |
|
Numeric(TableColLength tclen)
Construct a Numeric object from a TableColLength. |
Method Summary | |
Numeric |
abs()
Return the absolute value of this Numeric. |
Numeric |
add(Numeric op)
Add the operand from the current value and return a new Numeric representing the result. |
java.lang.Double |
asDouble()
|
Length |
asLength()
Return the current value as a Length if possible. |
java.lang.Number |
asNumber()
Return the current value as a Number if possible. |
Numeric |
divide(Numeric op)
Divide the the current value by the operand and return a new Numeric representing the result. |
Numeric |
max(Numeric op)
Return a Numeric which is the maximum of the current value and the operand. |
Numeric |
min(Numeric op)
Return a Numeric which is the minimum of the current value and the operand. |
Numeric |
multiply(Numeric op)
Multiply the the current value by the operand and return a new Numeric representing the result. |
Numeric |
subtract(Numeric op)
Subtract the operand from the current value and return a new Numeric representing the result. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int ABS_LENGTH
public static final int PC_LENGTH
public static final int TCOL_LENGTH
Constructor Detail |
protected Numeric(int valType, double absValue, double pcValue, double tcolValue, int dim, PercentBase pcBase)
valType
- A combination of bits representing the value types.absValue
- The value of a Number or resolved Length value if
the ABS_LENGTH flag is set.pcValue
- The decimal percent value if the PC_LENGTH flag is settcolValue
- The decimal table unit value if the TCOL_LENGTH flag
is set.dim
- The dimension of the value. 0 for a Number, 1 for a Length
(any type), >1, <0 if Lengths have been multiplied or divided.public Numeric(java.lang.Number num)
num
- The number.public Numeric(Length l)
l
- The Length.public Numeric(PercentLength pclen)
pclen
- The PercentLength.public Numeric(TableColLength tclen)
tclen
- The TableColLength.Method Detail |
public Length asLength()
public java.lang.Number asNumber()
public java.lang.Double asDouble()
public Numeric subtract(Numeric op) throws PropertyException
op
- The value to subtract.public Numeric add(Numeric op) throws PropertyException
op
- The value to add.public Numeric multiply(Numeric op) throws PropertyException
op
- The multiplier.public Numeric divide(Numeric op) throws PropertyException
op
- The divisor.public Numeric abs()
public Numeric max(Numeric op) throws PropertyException
public Numeric min(Numeric op) throws PropertyException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |