magoffin.matt.ma2.support
Class Geometry

java.lang.Object
  extended by magoffin.matt.ma2.support.Geometry

public class Geometry
extends java.lang.Object

Simple class to represent a width and height.

Author:
Matt Magoffin (spamsqr@msqr.us)

Nested Class Summary
static class Geometry.Mode
          Geometry mode.
 
Constructor Summary
Geometry()
          Default constructor.
Geometry(int width, int height)
          Construct a Geometry with width and height.
Geometry(int width, int height, Geometry.Mode mode)
          Construct a Geometry with width, height, and mode.
 
Method Summary
 int getHeight()
          Returns the height.
 Geometry.Mode getMode()
          Returns the mode.
 int getWidth()
          Returns the width.
 void reset()
          Reset this object to its default state.
 void setHeight(int height)
          Sets the height.
 void setMode(Geometry.Mode mode)
          Sets the mode.
 void setWidth(int width)
          Sets the width.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Geometry

public Geometry()
Default constructor.


Geometry

public Geometry(int width,
                int height)
Construct a Geometry with width and height.

Parameters:
width -
height -

Geometry

public Geometry(int width,
                int height,
                Geometry.Mode mode)
Construct a Geometry with width, height, and mode.

Parameters:
width -
height -
mode -
Method Detail

getHeight

public int getHeight()
Returns the height.

Returns:
int

getWidth

public int getWidth()
Returns the width.

Returns:
int

setHeight

public void setHeight(int height)
Sets the height.

Parameters:
height - The height to set

setWidth

public void setWidth(int width)
Sets the width.

Parameters:
width - The width to set

getMode

public Geometry.Mode getMode()
Returns the mode.

The mode should be one of the defined constants Geometry.Mode.MAX, Geometry.Mode.MIN, or Geometry.Mode.EXACT.

Returns:
the mode

setMode

public void setMode(Geometry.Mode mode)
Sets the mode.

The mode should be one of the defined constants Geometry.Mode.MAX, Geometry.Mode.MIN, or Geometry.Mode.EXACT.

Parameters:
mode - the new mode

reset

public void reset()
Reset this object to its default state.


toString

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