org.apache.fop.traits
Class MinOptMax
java.lang.Object
org.apache.fop.traits.MinOptMax
- Cloneable, java.io.Serializable
public class MinOptMax
extends java.lang.Object
implements java.io.Serializable, Cloneable
This class holds the resolved (as mpoints) form of a LengthRange or
Space type Property value.
MinOptMax values are used during layout calculations. The instance
variables are package visible.
int | max
|
int | min - Publicly visible min(imum), opt(imum) and max(imum) values.
|
int | opt
|
min
public int min
Publicly visible min(imum), opt(imum) and max(imum) values.
MinOptMax
public MinOptMax()
New min/opt/max with zero values.
MinOptMax
public MinOptMax(int val)
New min/opt/max with one fixed value.
val
- the value for min, opt and max
MinOptMax
public MinOptMax(int min,
int opt,
int max)
New min/opt/max with the three values.
min
- the minimum valueopt
- the optimum valuemax
- the maximum value
MinOptMax
public MinOptMax(MinOptMax op)
Copy constructor.
op
- the MinOptMax object to copy
add
public void add(int len)
Adds a length to all components.
add
public void add(int min,
int opt,
int max)
Adds min, opt and max to their counterpart components.
min
- the value to add to the minimum valueopt
- the value to add to the optimum valuemax
- the value to add to the maximum value
add
public void add(MinOptMax op)
Adds another MinOptMax instance to this one.
add
public static MinOptMax add(MinOptMax op1,
MinOptMax op2)
Adds one MinOptMax instance to another returning a new one.
op1
- first instanceop2
- second instance
clone
public Object clone()
isElastic
public boolean isElastic()
- true if this instance allows for shrinking or stretching
isNonZero
public boolean isNonZero()
- true if this instance represents a zero-width length (min=opt=max=0)
multiply
public static MinOptMax multiply(MinOptMax op1,
double mult)
Multiplies a MinOptMax instance with a factor returning a new instance.
op1
- MinOptMax instancemult
- multiplier
subtract
public void subtract(MinOptMax op)
Subtracts another MinOptMax instance from this one.
subtract
public static MinOptMax subtract(MinOptMax op1,
MinOptMax op2)
Subtracts one MinOptMax instance from another returning a new one.
op1
- first instance to subtract fromop2
- second instance
toString
public String toString()
java.lang.Object.toString()
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.