vendor/Pods/NanoStore/Classes/Public/NSFNanoExpression.m in nano-store-0.6.2 vs vendor/Pods/NanoStore/Classes/Public/NSFNanoExpression.m in nano-store-0.6.3
- old
+ new
@@ -29,17 +29,15 @@
#import "NSFOrderedDictionary.h"
@implementation NSFNanoExpression
{
/** \cond */
- NSMutableArray *predicates;
- NSMutableArray *operators;
+ NSMutableArray *_predicates;
+ NSMutableArray *_operators;
/** \endcond */
}
-@synthesize predicates, operators;
-
+ (NSFNanoExpression*)expressionWithPredicate:(NSFNanoPredicate *)aPredicate
{
return [[self alloc]initWithPredicate:aPredicate];
}
@@ -50,14 +48,14 @@
reason:[NSString stringWithFormat:@"*** -[%@ %@]: the predicate is nil.", [self class], NSStringFromSelector(_cmd)]
userInfo:nil]raise];
}
if ((self = [super init])) {
- predicates = [NSMutableArray new];
- [predicates addObject:aPredicate];
- operators = [NSMutableArray new];
- [operators addObject:[NSNumber numberWithInt:NSFAnd]];
+ _predicates = [NSMutableArray new];
+ [_predicates addObject:aPredicate];
+ _operators = [NSMutableArray new];
+ [_operators addObject:[NSNumber numberWithInt:NSFAnd]];
}
return self;
}
@@ -73,12 +71,12 @@
if (nil == aPredicate)
[[NSException exceptionWithName:NSFUnexpectedParameterException
reason:[NSString stringWithFormat:@"*** -[%@ %@]: the predicate is nil.", [self class], NSStringFromSelector(_cmd)]
userInfo:nil]raise];
- [predicates addObject:aPredicate];
- [operators addObject:[NSNumber numberWithInt:someOperator]];
+ [_predicates addObject:aPredicate];
+ [_operators addObject:[NSNumber numberWithInt:someOperator]];
}
- (NSString *)description
{
NSArray *values = [self arrayDescription];
@@ -86,17 +84,17 @@
return [values componentsJoinedByString:@""];
}
- (NSArray *)arrayDescription
{
- NSUInteger i, count = [predicates count];
+ NSUInteger i, count = [_predicates count];
NSMutableArray *values = [NSMutableArray new];
// We always have one predicate, so make sure add it
- [values addObject:[[predicates objectAtIndex:0]description]];
+ [values addObject:[[_predicates objectAtIndex:0]description]];
for (i = 1; i < count; i++) {
- NSString *compound = [[NSString alloc]initWithFormat:@" %@ %@", ([[operators objectAtIndex:i]intValue] == NSFAnd) ? @"AND" : @"OR", [[predicates objectAtIndex:i]description]];
+ NSString *compound = [[NSString alloc]initWithFormat:@" %@ %@", ([[_operators objectAtIndex:i]intValue] == NSFAnd) ? @"AND" : @"OR", [[_predicates objectAtIndex:i]description]];
[values addObject:compound];
}
return values;
}
\ No newline at end of file