Archived
1

Added Documentation

This commit is contained in:
Kim Wittenburg
2014-11-10 21:45:50 +01:00
parent f4f924bd71
commit 10f0e73ad3
32 changed files with 1847 additions and 318 deletions

View File

@@ -8,8 +8,10 @@
#import "MPExpression.h"
/// Convenience Constructor Macro
#define MPMakeRangePath(loc, len) [MPRangePath rangePathWithLocation:(loc) length:(len)]
@class MPRangePath, MPExpression;
@@ -27,7 +29,11 @@
*/
@interface MPRangePath : NSObject <NSCopying, NSCoding>
#pragma mark Creation Methods
/*!
@methodgroup Creation Methods
*/
/*!
@@ -80,7 +86,7 @@
/*!
@method emptyRangePath
@method rangePath
@brief Allocates and initializes an empty @c NSRangePath instance.
@discussion An empty range path's location has @c 0 indexes and a length of
@@ -88,7 +94,23 @@
@return A newly created @c MPRangePath instance.
*/
+ (instancetype)emptyRangePath;
+ (instancetype)rangePath;
/*!
@method rangePathWithRange:
@brief Allocates a new @c MPRangePath instance and initializes it with
the given location and length.
@discussion The location of @c aRange is translated into an index path for
the range path.
@param aRange
The range to be converted into a range path.
@return A newly created @c MPRangePath instance.
*/
+ (instancetype)rangePathWithRange:(NSRange)aRange;
/*!
@@ -110,22 +132,10 @@
length:(NSUInteger)length;
/*!
@method rangePathWithRange:
@brief Allocates a new @c MPRangePath instance and initializes it with
the given location and length.
@discussion The location of @c aRange is translated into an index path for
the range path.
@param aRange
The range to be converted into a range path.
@return A newly created @c MPRangePath instance.
*/
+ (instancetype)rangePathWithRange:(NSRange)aRange;
#pragma mark Properties
/*!
@methodgroup Properties
*/
/*!
@@ -165,26 +175,11 @@
*/
- (NSRange)rangeAtLastIndex;
#pragma mark Working with Ranges
#pragma mark Working With Ranges
/*!
@method containsRangePath:
@brief Checks wether the receiver completely contains @c aRangePath.
@discussion A range path is contained by another range path if either the
receiver's range at its last index contains the index at the
respective location of the location path of @c aRangePath or (if
the locations are of the same length) the receiver's range at its
last index contains the last index's range of @c aRangePath.
@param aRangePath
The range path to check wether it is contained in the receiver.
@return @c YES if the range path addressed by the receiver also includes
@c aRangePath, @c NO otherwise.
@methodgroup Working With Ranges
*/
- (BOOL)containsRangePath:(MPRangePath *)aRangePath;
/*!
@@ -207,7 +202,23 @@
- (BOOL)containsLocation:(NSIndexPath *)location;
- (BOOL)isEqual:(id)object;
/*!
@method containsRangePath:
@brief Checks wether the receiver completely contains @c aRangePath.
@discussion A range path is contained by another range path if either the
receiver's range at its last index contains the index at the
respective location of the location path of @c aRangePath or (if
the locations are of the same length) the receiver's range at its
last index contains the last index's range of @c aRangePath.
@param aRangePath
The range path to check wether it is contained in the receiver.
@return @c YES if the range path addressed by the receiver also includes
@c aRangePath, @c NO otherwise.
*/
- (BOOL)containsRangePath:(MPRangePath *)aRangePath;
/*!
@@ -229,6 +240,8 @@
@end
@interface MPExpression (MPRangeExtension)
@@ -252,6 +265,27 @@
- (MPExpression *)subexpressionWithRangePath:(MPRangePath *)aRangePath
referenceFrame:(MPReferenceFrame)referenceFrame;
/*!
@method replaceItemsInRangePath:referenceFrame:withElements:
@brief Replaces the items in the specified range path with the contents
of @c elements.
@discussion All objects in the @c elements array must conform to the @c
MPExpressionElement protocol. If one or more objects do not
conform to the protocol a @c MPIllegalElementException will be
raised.
@param rangePath
The range path to be replaced. The path of the range path is
expressed in the element reference frame. The range of the range
path is expressed in the specified @c referenceFrame.
@param referenceFrame
The reference frame to use. This only applies to the range at the
last index of the range path. The path of the range path is
always expressed in the element reference frame.
*/
- (void)replaceItemsInRangePath:(MPRangePath *)rangePath
referenceFrame:(MPReferenceFrame)referenceFrame
withElements:(NSArray *)elements;