Some small corrections to the MPExpression and MPFunction interfaces
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
#pragma mark Primitive Methods
|
#pragma mark Primitive Methods
|
||||||
|
|
||||||
- (NSUInteger)numberOfSymbols;
|
- (NSUInteger)numberOfSymbols;
|
||||||
- (id)symbolAtIndex:(NSUInteger)index; // Either an NSString or a MPFunction
|
- (id)symbolAtIndex:(NSUInteger)index; // Either an NSString or a MPFunction (which can be mutated)
|
||||||
|
|
||||||
- (double)doubleValue; // Evaluates Expression
|
- (double)doubleValue; // Evaluates Expression
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
@interface MPMutableExpression : MPExpression
|
@interface MPMutableExpression : MPExpression
|
||||||
|
|
||||||
- (void)replaceSymbolsInRange:(NSRange)range withExpression:(MPExpression *)anExpression;
|
- (void)replaceSymbolsInRange:(NSRange)range withSymbols:(NSArray *)symbols;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
@class MPFunction, MPExpression;
|
@class MPFunction, MPExpression;
|
||||||
|
|
||||||
@interface MPFunction : NSObject
|
@interface MPFunction : NSObject <NSCopying, NSCoding>
|
||||||
|
|
||||||
#pragma mark Creation Methods
|
#pragma mark Creation Methods
|
||||||
|
|
||||||
@@ -17,28 +17,32 @@
|
|||||||
#pragma mark Children
|
#pragma mark Children
|
||||||
|
|
||||||
- (NSUInteger)numberOfChildren;
|
- (NSUInteger)numberOfChildren;
|
||||||
- (MPExpression *)childAtIndex;
|
- (MPExpression *)childAtIndex:(NSUInteger)index;
|
||||||
- (void)setChild:(MPExpression *)child atIndex:(NSUInteger)index;
|
- (void)setChild:(MPExpression *)child atIndex:(NSUInteger)index;
|
||||||
|
|
||||||
#pragma mark Evaluating Functions
|
#pragma mark Evaluating Functions
|
||||||
|
|
||||||
- (double)doubleValue;
|
- (double)doubleValue;
|
||||||
|
|
||||||
|
#pragma mark Working With Functions
|
||||||
|
|
||||||
|
- (BOOL)isEqualToFunction:(MPFunction *)aFunction;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MPFunction (MPFunctionExtensionMethods)
|
@interface MPFunction (MPFunctionExtensionMethods)
|
||||||
|
|
||||||
#pragma mark Children
|
#pragma mark Children
|
||||||
|
|
||||||
|
// May be overridden for performance improvements
|
||||||
- (NSArray *)children;
|
- (NSArray *)children;
|
||||||
|
|
||||||
#pragma mark Evaluating Expressions
|
#pragma mark Evaluating Functions
|
||||||
|
|
||||||
- (float)floatValue;
|
- (float)floatValue;
|
||||||
- (int)intValue;
|
- (int)intValue;
|
||||||
- (NSInteger)integerValue;
|
- (NSInteger)integerValue;
|
||||||
- (long long)longLongValue;
|
- (long long)longLongValue;
|
||||||
- (NSString *)stringValue;
|
|
||||||
|
|
||||||
- (NSString *)description;
|
- (NSString *)description;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user