5 // Created by Evan Schoenberg on 7/31/06.
8 #import "AICalendarDate.h"
11 @implementation AICalendarDate
13 * @brief Initialize with coder
15 - (id)initWithCoder:(NSCoder *)decoder
17 if ((self = [super initWithCoder:decoder])) {
18 if ([decoder allowsKeyedCoding]) {
19 granularity = [[decoder decodeObjectForKey:@"Granularity"] intValue];
21 granularity = [[decoder decodeObject] intValue];
28 - (void)encodeWithCoder:(NSCoder *)encoder
30 [super encodeWithCoder:encoder];
32 if ([encoder allowsKeyedCoding]) {
33 [encoder encodeObject:[NSNumber numberWithInt:granularity] forKey:@"Granularity"];
36 [encoder encodeObject:[NSNumber numberWithInt:granularity]];
40 - (id)copyWithZone:(NSZone *)inZone
42 AICalendarDate *newDate = [super copyWithZone:inZone];
43 newDate->granularity = granularity;
48 - (void)setGranularity:(AICalendarDateGranularity)inGranularity
50 granularity = inGranularity;
52 - (AICalendarDateGranularity)granularity