net.aerith.misao.util
Class Size

java.lang.Object
  |
  +--net.aerith.misao.util.Size

public class Size
extends java.lang.Object

The Size represents a size which consists of width and height. Both width and height must be 0 or positive. In the case of negative value is given to set, it is converted to 0.


Field Summary
private  int height
          The height value.
private  int width
          The width value.
 
Constructor Summary
Size()
          Constructs a Size.
Size(int initial_width, int initial_height)
          Constructs a Size with widht and height value.
 
Method Summary
 int getHeight()
          Gets the height value.
 int getWidth()
          Gets the width value.
protected  java.lang.String paramString()
          Returns a raw string representation of the state of this object, for debugging use.
 void setHeight(int new_height)
          Sets the height value.
 void setWidth(int new_width)
          Sets the width value.
 java.lang.String toString()
          Returns a string representation of the state of this object, for debugging use.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

width

private int width
The width value.

height

private int height
The height value.
Constructor Detail

Size

public Size()
Constructs a Size. Both width and height are set as 0.

Size

public Size(int initial_width,
            int initial_height)
Constructs a Size with widht and height value.
Parameters:
initial_width - the initial width value.
initial_height - the initial height value.
Method Detail

getWidth

public int getWidth()
Gets the width value.
Returns:
the width value.

setWidth

public void setWidth(int new_width)
Sets the width value.
Parameters:
new_width - the new width value.

getHeight

public int getHeight()
Gets the height value.
Returns:
the height value.

setHeight

public void setHeight(int new_height)
Sets the height value.
Parameters:
new_height - the new height value.

paramString

protected java.lang.String paramString()
Returns a raw string representation of the state of this object, for debugging use. It should be invoked from toString method of the subclasses.
Returns:
a string representation of the state of this object.

toString

public java.lang.String toString()
Returns a string representation of the state of this object, for debugging use.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the state of this object.