Archived
1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mathpad/MathKit/MPExpressionElement.h
Kim Wittenburg 8f1f730358 Reorganized File Structure
Added Documentation
2014-12-12 00:39:30 +01:00

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