GVGraphArguments.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*************************************************************************
  2. * Copyright (c) 2011 AT&T Intellectual Property
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * https://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors: Details at http://www.graphviz.org/
  9. *************************************************************************/
  10. #import "GVGraphArguments.h"
  11. #import "GVZGraph.h"
  12. @implementation GVGraphArguments
  13. - (id)initWithGraph:(GVZGraph *)graph
  14. {
  15. if (self = [super init]) {
  16. _graph = graph; /* no retain to avoid a retain cycle */
  17. _arguments = [[NSMutableDictionary alloc] init];
  18. }
  19. return self;
  20. }
  21. - (NSUInteger)count
  22. {
  23. return [_arguments count];
  24. }
  25. - (NSEnumerator *)keyEnumerator
  26. {
  27. return [_arguments keyEnumerator];
  28. }
  29. - (id)objectForKey:(id)aKey
  30. {
  31. return [_arguments objectForKey:aKey];
  32. }
  33. /* mutable dictionary primitive methods */
  34. - (void)setObject:(id)anObject forKey:(id)aKey
  35. {
  36. [_arguments setObject:anObject forKey:aKey];
  37. [_graph noteChanged:YES];
  38. }
  39. - (void)removeObjectForKey:(id)aKey
  40. {
  41. [_arguments removeObjectForKey:aKey];
  42. [_graph noteChanged:YES];
  43. }
  44. - (void)dealloc
  45. {
  46. [_arguments release];
  47. [super dealloc];
  48. }
  49. @end