|
point Specification SheetPortable Object Compiler (c) 1997,98,99. All Rights Reserved.
PointInherits from: Object
Class DescriptionPoint instances are implemented as pairs of two C integers. This is partly because of compatibility with the corresponding ICpak101 class, and partly because it (as opposed to some floating point arithmetic) gives portable results for equality testing.
Method typesCreationInstance VariablesComparingPoint ArithmeticPrintingMethodsnew+newReturns the point (0,0).
x:y:+x:(int)xy:(int)yReturns the point (x,y).
x:y:-x:(int)xy:(int)yResets the coordinates of an existing point to (x,y).
x:-x:(int)xResets the xLoc coordinate. Returns the receiver.
y:-y:(int)yResets the yLoc coordinate. Returns the receiver.
x- (int)xReturns xLoc as int value.
y- (int)yReturns yLoc as int value.
hash- (unsigned)hashReturns a hash value based on the values of xLoc and yLoc.
isEqual:- (BOOL)isEqual:aPointReturns YES if both arguments are instances of Point (or of a subclass of Point) and if they have the same coordinates.
isBelow:- (BOOL)isBelow:aPointReturns YES if the receiver's y coordinate is greater than the y coordinate of aPoint.
isAbove:- (BOOL)isAbove:aPointReturns YES if the receiver's y coordinate is less than the y coordinate of aPoint.
isLeft:- (BOOL)isLeft:aPointReturns YES if the receiver's x coordinate is less than the x coordinate of aPoint.
isRight:- (BOOL)isRight:aPointReturns YES if the receiver's x coordinate is greater than the x coordinate of aPoint.
moveBy:-moveBy:aPointAdds coordinates of aPoint to the receiver. Unlike plus:, this method does not return a new object.
moveBy::-moveBy:(int)x:(int)yAdds x and y coordinates of aPoint to the receiver. Unlike plus:, this method does not return a new object.
moveTo:-moveTo:aPointCopies the coordinates of aPoint into the receiver. Typically used for translation.
plus:-plus:aPointThis method is like moveBy: but it returns a new point instance.
translateBy:-translateBy:aPointThis method is like moveBy: but it returns a new point instance.
printOn:-printOn:(IOD)aFilePrints x and y coordinates inside parenthesis.
fileOutOn:-fileOutOn:aFilerWrites the point on aFiler. Returns the receiver.
fileInFrom:-fileInFrom:aFilerReads the point from aFiler. Returns the receiver.
|