PATH  Documentation > Mac OS X > Foundation Reference: Java



Table of Contents

NSMutableSize


Inherits from:
NSSize : Object
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


Constructors
NSMutableSize
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 NSMutableSize with the width dimension w and the height dimension y; it throws an IllegalArgumentException if either value is negative.

NSMutableSize(NSSize aSize)

Initializes 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



clone

public Object clone()

Description forthcoming.

height

public float height()

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

See Also: setHeight, 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, setWidth




Table of Contents