Developer Documentation
PATH  Mac OS X Documentation > Foundation Reference: Java


[Previous] [Class List] [Next]

NSMutableSize


Inherits from: NSSize : Object
Implements: Cloneable (inherited from NSSize)
Package: com.apple.yellow.foundation


Class Description


An NSMutableSize is an object representing a dimension that can be changed. The main purpose for NSMutableSizes is to provide away for methods to return size values in an "out" parameter. The client creates and passes in one or more NSMutableSizes to a method and gets back changed objects when the method returns. NSMutableSizes are also useful for performance reasons; instead of creating multiple NSSizes in a loop, you can create just one NSMutableSize and reuse it.


Method Types


Accessing and setting dimensions
height
setHeight
width
setWidth

Constructors


NSMutableSize

NSMutableSize()

Initializes an "empty" NSMutableSize (one whose height or width is zero).

NSMutableSize(float w, float h)

Initializes the the NSMutableSize with the width dimension w and the height dimension y; it throws an IllegalArgumentException if either value is negative.

NSMutableSize(NSSize aSize)

Intializes the new NSMutableSize with the width and height values of an existing NSSize aSize; this constructor is used in cloning the receiver.

NSMutableSize(java.awt.Dimension dimension)

Initializes an NSMutableSize with the values extracted from an AWT Dimension object.

Instance Methods



finalize

protected void finalize()

This method performs implementation-specific cleanup tasks. If you override this class in a subclass, be sure to invoke super's implementation.

height

public float height()

Returns the height dimension of the receiver. NSMutableSize overrides this method because implementation details make that necessary

See Also: width



setHeight

public void setHeight(float newHeight)

Sets the height dimension of the receiver to newHeight. Throws an IllegalArgumentException if newHeight is negative or is NaN (an invalid float value).

See Also: height



setWidth

public void setWidth(float newWidth)

Sets the width dimension of the receiver to newWidth. Throws an IllegalArgumentException if newWidth is negative or is NaN (an invalid float value).

See Also: width



width

public float width()

Returns the width of the receiver. NSMutableSize overrides this method because implementation details make that necessary.

See Also: height




[Previous] [Next]