58 lines
1.4 KiB
Objective-C
58 lines
1.4 KiB
Objective-C
//
|
|
// MPExpressionElement.h
|
|
// MathPad
|
|
//
|
|
// Created by Kim Wittenburg on 10.08.14.
|
|
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
|
//
|
|
|
|
|
|
|
|
/*!
|
|
@protocol MPExpressionElement
|
|
@brief This protocol defines the functionality an element in an
|
|
expression must have.
|
|
*/
|
|
@protocol MPExpressionElement <NSObject, NSCopying, NSCoding>
|
|
|
|
|
|
/*!
|
|
@method isString
|
|
@brief Returns wether the receiver is a string.
|
|
|
|
@discussion A string is defined by being an instance of @c NSString. If this
|
|
method returns @c YES you can be sure it is an @c NSString
|
|
instance.
|
|
|
|
@return @c YES if the receiver is a string, @c NO otherwise.
|
|
*/
|
|
- (BOOL)isString;
|
|
|
|
|
|
/*!
|
|
@method isFunction
|
|
@brief Returns wether the receiver is a function.
|
|
|
|
@discussion A function is defined by being an instance of @c MPFunction. If
|
|
this method returns @c YES you can be sure it is a @c MPFunction
|
|
instance.
|
|
|
|
@return @c YES if the receiver is a function, @c NO otherwise.
|
|
*/
|
|
- (BOOL)isFunction;
|
|
|
|
|
|
/*!
|
|
@method length
|
|
@brief Calculates the length of the receiver.
|
|
|
|
@discussion The length of a @c MPExpressionElement is the number of symbols
|
|
it consists of. For strings this is the number of characters in
|
|
it. Functions have a length of @c 1.
|
|
|
|
@return The receiver's length.
|
|
*/
|
|
- (NSUInteger)length;
|
|
|
|
@end
|