fop 0.95

org.apache.fop.traits
Class MinOptMax

java.lang.Object
  extended by org.apache.fop.traits.MinOptMax
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MinOptMax
extends java.lang.Object
implements java.io.Serializable, java.lang.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.

See Also:
Serialized Form

Field Summary
 int max
           
 int min
          Publicly visible min(imum), opt(imum) and max(imum) values.
 int opt
           
 
Constructor Summary
MinOptMax()
          New min/opt/max with zero values.
MinOptMax(int val)
          New min/opt/max with one fixed value.
MinOptMax(int min, int opt, int max)
          New min/opt/max with the three values.
MinOptMax(MinOptMax op)
          Copy constructor.
 
Method Summary
 void add(int len)
          Adds a length to all components.
 void add(int min, int opt, int max)
          Adds min, opt and max to their counterpart components.
 void add(MinOptMax op)
          Adds another MinOptMax instance to this one.
static MinOptMax add(MinOptMax op1, MinOptMax op2)
          Adds one MinOptMax instance to another returning a new one.
 java.lang.Object clone()
          
 boolean isElastic()
           
 boolean isNonZero()
           
static MinOptMax multiply(MinOptMax op1, double mult)
          Multiplies a MinOptMax instance with a factor returning a new instance.
 void subtract(MinOptMax op)
          Subtracts another MinOptMax instance from this one.
static MinOptMax subtract(MinOptMax op1, MinOptMax op2)
          Subtracts one MinOptMax instance from another returning a new one.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

public int min
Publicly visible min(imum), opt(imum) and max(imum) values.


opt

public int opt

max

public int max
Constructor Detail

MinOptMax

public MinOptMax()
New min/opt/max with zero values.


MinOptMax

public MinOptMax(int val)
New min/opt/max with one fixed value.

Parameters:
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.

Parameters:
min - the minimum value
opt - the optimum value
max - the maximum value

MinOptMax

public MinOptMax(MinOptMax op)
Copy constructor.

Parameters:
op - the MinOptMax object to copy
Method Detail

clone

public java.lang.Object clone()

Overrides:
clone in class java.lang.Object

subtract

public static MinOptMax subtract(MinOptMax op1,
                                 MinOptMax op2)
Subtracts one MinOptMax instance from another returning a new one.

Parameters:
op1 - first instance to subtract from
op2 - second instance
Returns:
MinOptMax new instance

add

public static MinOptMax add(MinOptMax op1,
                            MinOptMax op2)
Adds one MinOptMax instance to another returning a new one.

Parameters:
op1 - first instance
op2 - second instance
Returns:
MinOptMax new instance

multiply

public static MinOptMax multiply(MinOptMax op1,
                                 double mult)
Multiplies a MinOptMax instance with a factor returning a new instance.

Parameters:
op1 - MinOptMax instance
mult - multiplier
Returns:
MinOptMax new instance

add

public void add(MinOptMax op)
Adds another MinOptMax instance to this one.

Parameters:
op - the other instance

add

public void add(int min,
                int opt,
                int max)
Adds min, opt and max to their counterpart components.

Parameters:
min - the value to add to the minimum value
opt - the value to add to the optimum value
max - the value to add to the maximum value

add

public void add(int len)
Adds a length to all components.

Parameters:
len - the length to add

subtract

public void subtract(MinOptMax op)
Subtracts another MinOptMax instance from this one.

Parameters:
op - the other instance

isNonZero

public boolean isNonZero()
Returns:
true if this instance represents a zero-width length (min=opt=max=0)

isElastic

public boolean isElastic()
Returns:
true if this instance allows for shrinking or stretching

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

fop 0.95

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.