DekGenius.com
[ Team LiB ] Previous Section Next Section

NSDecimalNumberHandler Mac OS X 10.0

This class is used to customize the behavior of NSDecimalNumber-based arithmetic without having to subclass. In particular, NSDecimalNumberHandler allows clients to specify how NSDecimalNumber objects should handle rounding and errors.

figs/cocn_1327.gif

@interface NSDecimalNumberHandler : NSObject <NSCoding, NSDecimalNumberBehaviors>
 // Initializers
   - (id)initWithRoundingMode:(NSRoundingMode)roundingMode scale:(short)scale raiseOnExactness:(BOOL)exact
        raiseOnOverflow:(BOOL)overflow raiseOnUnderflow:(BOOL)underflow raiseOnDivideByZero:(BOOL)divideByZero;
 // Class Methods
   + (id)decimalNumberHandlerWithRoundingMode:(NSRoundingMode)roundingMode
        scale:(short)scale raiseOnExactness:(BOOL)exact raiseOnOverflow:(BOOL)overflow
        raiseOnUnderflow:(BOOL)underflow raiseOnDivideByZero:(BOOL)divideByZero;
   + (id)defaultDecimalNumberHandler;
 // Methods Implementing NSCoding
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;
 // Methods Implementing NSDecimalNumberBehaviors
   - (NSRoundingMode)roundingMode;
   - (short)scale;
   - (NSDecimalNumber *)exceptionDuringOperation:(SEL)operation error:(NSCalculationError)error
        leftOperand:(NSDecimalNumber *)leftOperand rightOperand:(NSDecimalNumber *)rightOperand;

    [ Team LiB ] Previous Section Next Section