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


[Previous] [Class List] [Next]

NSMutablePoint


Inherits from: Object
Implements: Cloneable (inherited from NSPoint
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


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 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



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.

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).

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).

x

public float x()

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

y

public float y()

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


[Previous] [Next]