SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class representing the size of a rectangle.
Constructor Summary | |
IWSize(width, height)
Creates a new size object with the specified dimension. |
Method Summary | |
IWSize
|
clone()
Returns a new instance of this object. |
number
|
compareTo(other)
Returns 1 if this size is larger than the other one, -1 if it is smaller and 0 if both sizes are the same. |
boolean
|
containsPoint(point)
Checks whether the specified point stands inside or outside this size. |
IWSize
|
divide(scalar)
Divides size by a scalar |
boolean
|
equals(other)
Checks whether the specified size and this one are the same. |
IWPoint
|
getCenter()
Interprets the size as a rectangle from (0, 0) to (w, h) and returns the center of it. |
number
|
getHeight()
Returns the height value. |
number
|
getWidth()
Returns the width value. |
|
multiplicate(scalar)
|
IWSize
|
multiply(scalar)
Multiplicates size by a scalar |
void
|
setHeight(height)
Sets the height value. |
void
|
setWidth(width)
Sets the width. |
String
|
toString()
Returns a string representation of this size in the form width x height .
|
Constructor Detail |
IWSize(width, height)
number width
- the width in pixels
number height
- the height in pixels
Method Detail |
IWSize clone()
IWSize
number compareTo(other)
IWSize other
- another size
number
boolean containsPoint(point)
IWPoint point
- a point
boolean
returns true
if the point is part of the size, otherwise it returns
false
.
IWSize divide(scalar)
Number scalar
IWSize
boolean equals(other)
IWSize other
- another size object
boolean
IWPoint getCenter()
IWPoint
the center, i.e. (width/2, height/2)
number getHeight()
number
number getWidth()
number
multiplicate(scalar)
scalar
IWSize multiply(scalar)
Number scalar
IWSize
void setHeight(height)
number height
- the new height
void
void setWidth(width)
number width
- the new width
void
String toString()
width x height
.
String