コード例 #1
0
  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;
  }
コード例 #2
0
  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;
  }