PageRenderTime 29ms CodeModel.GetById 18ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Analytics/GDataAnalyticsAggregateGroup.m

http://macfuse.googlecode.com/
Objective C | 70 lines | 36 code | 17 blank | 17 comment | 1 complexity | 36da0164a5358870a0a5f2c6d83aa00c MD5 | raw file
 1/* Copyright (c) 2009 Google Inc.
 2 *
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 *
 7 *     http://www.apache.org/licenses/LICENSE-2.0
 8 *
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16//
17//  GDataAnalyticsAggregateGroup.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
21
22#import "GDataAnalyticsAggregateGroup.h"
23
24#import "GDataAnalyticsConstants.h"
25#import "GDataAnalyticsMetric.h"
26
27@implementation GDataAnalyticsAggregateGroup
28
29+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
30+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
31+ (NSString *)extensionElementLocalName { return @"aggregates"; }
32
33- (void)addExtensionDeclarations {
34  [super addExtensionDeclarations];
35
36  [self addExtensionDeclarationForParentClass:[self class]
37                                   childClass:[GDataAnalyticsMetric class]];
38}
39
40#if !GDATA_SIMPLE_DESCRIPTIONS
41- (NSMutableArray *)itemsForDescription {
42
43  static struct GDataDescriptionRecord descRecs[] = {
44    { @"metrics", @"metrics", kGDataDescArrayDescs },
45    { nil, nil, (GDataDescRecTypes)0 }
46  };
47
48  NSMutableArray *items = [super itemsForDescription];
49  [self addDescriptionRecords:descRecs toItems:items];
50  return items;
51}
52#endif
53
54#pragma mark -
55
56- (NSArray *)metrics {
57  return [self objectsForExtensionClass:[GDataAnalyticsMetric class]];
58}
59
60- (void)setMetrics:(NSArray *)array {
61  [self setObjects:array forExtensionClass:[GDataAnalyticsMetric class]];
62}
63
64- (void)addMetric:(GDataAnalyticsMetric *)obj {
65  [self addObject:obj forExtensionClass:[GDataAnalyticsMetric class]];
66}
67
68@end
69
70#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE