PATH  Documentation > Mac OS X > Foundation Reference: Java



Table of Contents

NSMutablePoint


Inherits from:
NSPoint : Object
Package:
com.apple.yellow.foundation


Class Description


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




Method Types


Constructors
NSMutablePoint
Accessing and setting coordinate values
setX
setY
x
y


Constructors



NSMutablePoint

public NSMutablePoint()

This constructor initializes the x and y coordinates to zero.

public NSMutablePoint( float x, float y)

Initializes the NSMutablePoint with the horizontal coordinate x and the vertical coordinate y.

public NSMutablePoint(NSPoint aPoint)

Initializes the new NSMutablePoint with the coordinate values of NSPoint aPoint; this constructor is used in cloning the receiver.

public NSMutablePoint(java.awt.Point javaPoint)

Initializes the NSPoint with the values extracted from an AWT Point object.


Instance Methods



clone

public Object clone()

Description forthcoming.

setX

public void setX(float newX)

Sets the x-coordinate of the receiver to newX. Throws an IllegalArgumentException if newX is NaN (that is not a valid float value).

See Also: x



setY

public void setY(float newY)

Sets the y-coordinate of the receiver to newY. Throws an IllegalArgumentException if newY is NaN (that is not a valid float value).

See Also: y



x

public float x()

Returns the x-coordinate of the receiver. NSMutablePoint overrides this method because implementation details make that necessary.

See Also: setX



y

public float y()

Returns the y-coordinate of the receiver. NSMutablePoint overrides this method because implementation details make that necessary.

See Also: setY




Table of Contents