protected static NSArray transformArray(NSArray array, NSDictionary lookup) { NSMutableArray transformedArray = new NSMutableArray(array.count()); Enumeration objects = array.objectEnumerator(); while (objects.hasMoreElements()) { Object object = objects.nextElement(); transformedArray.addObject(RuleModelUtilities.transform(object, lookup)); } return transformedArray; }
protected static NSDictionary transformDictionary(NSDictionary dictionary, NSDictionary lookup) { NSMutableDictionary transformedDictionary = new NSMutableDictionary(dictionary.count()); Enumeration keys = dictionary.keyEnumerator(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = dictionary.objectForKey(key); transformedDictionary.setObjectForKey(RuleModelUtilities.transform(value, lookup), key); } return transformedDictionary; }