PageRenderTime 22ms CodeModel.GetById 19ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/OJCov/OJCoverageSelector.j

http://github.com/hammerdr/OJTest
Unknown | 40 lines | 33 code | 7 blank | 0 comment | 0 complexity | 65ea64a852c6009831a85282ab9b67bc MD5 | raw file
 1@import <Foundation/CPObject.j>
 2
 3@implementation OJCoverageSelector : CPObject
 4{
 5    Class       klass           @accessors(readonly);
 6    SEL         selector        @accessors(readonly);
 7}
 8
 9+ (id)selectorWithClassName:aClass selector:(SEL)aSelector
10{
11    return [[[self class] alloc] initWithClassName:aClass selector:aSelector];
12}
13
14+ (id)selectorWithObject:(id)anObject selector:(SEL)aSelector
15{
16    return [[[self class] alloc] initWithClassName:[anObject class] selector:aSelector];
17}
18
19- (id)initWithClassName:(CPString)aKlass selector:(SEL)aSelector
20{
21    self = [super init];
22    if(self)
23    {
24        klass = aKlass;
25        selector = aSelector;
26    }
27    return self;
28}
29
30- (BOOL)isEqual:(OJCoverageSelector)anotherSelector
31{
32    return klass == [anotherSelector klass] && [[self selector] isEqualToString:[anotherSelector selector]];
33}
34
35- (CPString)description
36{
37    return [CPString stringWithFormat:@"%@[%@]", klass, selector];
38}
39
40@end