|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.core.dimen.DimenConstant
org.extex.core.dimen.Dimen
public class Dimen
This class implements the dimen value. This is a length with fixed point arithmetic.
| Field Summary | |
|---|---|
static long |
ONE
The constant ONE contains the internal representation for 1pt. |
static FixedDimen |
ONE_INCH
The constant ONE_INCH contains the immutable dimen register representing the length of 1 in. |
static FixedDimen |
ONE_PT
The constant ONE_PT contains the immutable dimen register representing the length of 1 pt. |
static FixedDimen |
ONE_SP
The constant ONE_SP contains the immutable dimen register representing the length of 1 scaled point. |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
static FixedDimen |
ZERO
The constant ZERO contains the non-stretchable and non-shrinkable value of 0 pt. |
static FixedDimen |
ZERO_PT
The constant ZERO_PT contains the immutable dimen register representing the length of 0 pt. |
| Fields inherited from class org.extex.core.dimen.DimenConstant |
|---|
value |
| Constructor Summary | |
|---|---|
Dimen()
Creates a new object. |
|
Dimen(FixedDimen value)
Creates a new object. |
|
Dimen(long value)
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
abs(FixedDimen d)
Set the value of this dimen to the absolute value of a given value. |
void |
add(FixedDimen d)
Add the value of the argument to the current value. |
void |
add(long d)
Add the value of the argument to the current value. |
void |
divide(long denom)
Divide the current value with a given number. |
boolean |
isZero()
Test for a value of zero. |
void |
max(FixedDimen d)
Sets the value of the dimen to the maximum of the value already stored and a given argument. |
void |
min(FixedDimen d)
Sets the value of the dimen to the minimum of the value already stored and a given argument. |
void |
multiply(long factor)
Multiply the current value with a given number. |
void |
multiply(long nom,
long denom)
Multiply the value by an integer fraction. |
void |
negate()
Negate the value of the argument to the current value. |
void |
set(FixedDimen d)
Setter for the value. |
void |
set(long d)
Setter for the value. |
void |
subtract(FixedDimen d)
Subtract the value of the argument from the current value. |
| Methods inherited from class org.extex.core.dimen.DimenConstant |
|---|
copy, eq, ge, getValue, gt, le, lt, ne, toString, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final FixedDimen ZERO
public static final long ONE
public static final FixedDimen ONE_INCH
public static final FixedDimen ONE_PT
public static final FixedDimen ONE_SP
protected static final long serialVersionUID
public static final FixedDimen ZERO_PT
| Constructor Detail |
|---|
public Dimen()
public Dimen(FixedDimen value)
value - the value to imitatepublic Dimen(long value)
value - the value to set| Method Detail |
|---|
public void abs(FixedDimen d)
d - the given valuepublic void add(FixedDimen d)
|this| → |this| + |d|
d - the Dimen to addpublic void add(long d)
|this| → |this| + |d|
d - the value to add in sp
public void divide(long denom)
throws java.lang.ArithmeticException
|this| → |this| / denom
denom - denominator to divide by
java.lang.ArithmeticException - in case of a division by 0, i.e. if denom is
0.public boolean isZero()
true iff the value is 0public void max(FixedDimen d)
d - the other dimenpublic void min(FixedDimen d)
d - the other dimen
public void multiply(long nom,
long denom)
length = length * nom / denom
nom - nominatordenom - denominatorpublic void multiply(long factor)
|this| → |this| * factor
factor - the factor to multiply withpublic void negate()
|this| → - |this|
public void set(FixedDimen d)
d - the new valuepublic void set(long d)
d - the new valuepublic void subtract(FixedDimen d)
|this| → |this| - |d|
d - the Dimen to subtract
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||