/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. // GDataAnalyticsAggregateGroup.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
  19. #import "GDataAnalyticsAggregateGroup.h"
  20. #import "GDataAnalyticsConstants.h"
  21. #import "GDataAnalyticsMetric.h"
  22. @implementation GDataAnalyticsAggregateGroup
  23. + (NSString *)extensionElementURI { return kGDataNamespaceAnalyticsDXP; }
  24. + (NSString *)extensionElementPrefix { return kGDataNamespaceAnalyticsDXPPrefix; }
  25. + (NSString *)extensionElementLocalName { return @"aggregates"; }
  26. - (void)addExtensionDeclarations {
  27. [super addExtensionDeclarations];
  28. [self addExtensionDeclarationForParentClass:[self class]
  29. childClass:[GDataAnalyticsMetric class]];
  30. }
  31. #if !GDATA_SIMPLE_DESCRIPTIONS
  32. - (NSMutableArray *)itemsForDescription {
  33. static struct GDataDescriptionRecord descRecs[] = {
  34. { @"metrics", @"metrics", kGDataDescArrayDescs },
  35. { nil, nil, (GDataDescRecTypes)0 }
  36. };
  37. NSMutableArray *items = [super itemsForDescription];
  38. [self addDescriptionRecords:descRecs toItems:items];
  39. return items;
  40. }
  41. #endif
  42. #pragma mark -
  43. - (NSArray *)metrics {
  44. return [self objectsForExtensionClass:[GDataAnalyticsMetric class]];
  45. }
  46. - (void)setMetrics:(NSArray *)array {
  47. [self setObjects:array forExtensionClass:[GDataAnalyticsMetric class]];
  48. }
  49. - (void)addMetric:(GDataAnalyticsMetric *)obj {
  50. [self addObject:obj forExtensionClass:[GDataAnalyticsMetric class]];
  51. }
  52. @end
  53. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE