summaryrefslogtreecommitdiffstats
path: root/Frameworks/LiPlugin/LiFilterDescription.m
blob: d5d38dad1ae95ef25aae1b9c80f05d97eb25cb2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//
//  LiFilterDescription.m
//  LiFrameworks
//
//  Created by Brian Cully on Sat Aug 23 2003.
//  Copyright (c) 2003 Brian Cully. All rights reserved.
//

#import "LiFilterDescription.h"

@implementation LiFilterDescription
+ (id)descriptionForMethod: (SEL)aMethod
                      name: (NSString *)aName
          compareOperators: (NSDictionary *)someOperators
           valueEditorCell: (NSCell *)aCell
{
    id tmpDesc;

    tmpDesc = [[self alloc] initWithMethod: aMethod
                                      name: aName
                          compareOperators: someOperators
                           valueEditorCell: aCell];
    return [tmpDesc autorelease];
}

- (id)init
{
    NSException *exception;

    exception = [NSException exceptionWithName: @"LiNoInitException"
                                        reason: @"[LiFilterDescription init] not supported"
                                      userInfo: nil];
    [exception raise];

    return nil;
}

- (void)dealloc
{
    [self setMethod: nil];
    [self setName: nil];
    [self setCompareOperators: nil];
    [self setValueEditorCell: nil];
    
    [super dealloc];
}

- (id)initWithMethod: (SEL)aMethod
                name: (NSString *)aName
    compareOperators: (NSDictionary *)someOperators
     valueEditorCell: (NSCell *)aCell
{
    self = [super init];

    [self setMethod: aMethod];
    [self setName: aName];
    [self setCompareOperators: someOperators];
    [self setValueEditorCell: aCell];
    
    return self;
}
@synthesize theName;
@synthesize theValueEditorCell;
@synthesize theCompareOperators;
@end

@implementation LiFilterDescription (Accessors)
- (SEL)method
{
    return theMethod;
}

- (void)setMethod: (SEL)aMethod
{
    theMethod = aMethod;
}

- (NSString *)name
{
    return theName;
}

- (void)setName: (NSString *)aName
{
    [aName retain];
    [theName release];
    aName = theName;
}

- (NSDictionary *)compareOperators
{
    return theCompareOperators;
}

- (void)setCompareOperators: (NSDictionary *)someOperators
{
    [someOperators retain];
    [theCompareOperators release];
    theCompareOperators = someOperators;
}

- (NSCell *)valueEditorCell
{
    return theValueEditorCell;
}

- (void)setValueEditorCell: (NSCell *)aCell
{
    [aCell retain];
    [theValueEditorCell release];
    theValueEditorCell = aCell;
}
@end