com.babaroga.test.packing
Class ConstantBoundsGenerator

java.lang.Object
  extended by com.babaroga.test.packing.BoundsGenerator
      extended by com.babaroga.test.packing.ConstantBoundsGenerator

public class ConstantBoundsGenerator
extends BoundsGenerator

Generates a constant bounding rectangle. Will only generate one bounding rectangle with the specified width and height. This is included for completeness.


Constructor Summary
ConstantBoundsGenerator(int width, int height)
          Constructs a bounding generator with specified width and height.
 
Method Summary
 boolean generate(boolean bPreviousPackSucceeded)
          Retrieves the next potential bounding rectangle.
 java.lang.String toString()
           
 
Methods inherited from class com.babaroga.test.packing.BoundsGenerator
getBounds, getNumBoundsTested, getPackedRectangles, pack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantBoundsGenerator

public ConstantBoundsGenerator(int width,
                               int height)
                        throws java.lang.IllegalArgumentException
Constructs a bounding generator with specified width and height.

Parameters:
width - The positive width of the bounding rectangle to be generated.
height - The positive height of the bounding rectangle to be generated.
Throws:
java.lang.IllegalArgumentException - If width or height <= 0.
Method Detail

generate

public boolean generate(boolean bPreviousPackSucceeded)
Description copied from class: BoundsGenerator
Retrieves the next potential bounding rectangle.

Parameters:
bPreviousPackSucceeded - Should be true if all rectangles were successfully packed in the previously generated bounds.
Returns:
the next potential bounding rectangle.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object