creates a Dictionary-representation of the map. If the map is an instance of {@link DictionaryAsMap} the original
dictionary is returned to prevent deeper nesting.
765132
public static <K, V> Dictionary<K, V> wrap(Map<K, V> map) {
        if (map instanceof DictionaryAsMap) {
            return ((DictionaryAsMap<K, V>) map).getDictionary();
        }
        return new MapAsDictionary<K, V>(map);
    }
1093856
public static Map<String, String> copyMap(Map<String, String> originalMap) {
        Objects.requireNonNull(originalMap, Required.MAP.toString());
        
        return new HashMap<>(originalMap);
    }
744409
public static <K, V, M extends Map<K, V>> UnmodifiableMutableMap<K, V> of(M map)
    {
        if (map == null)
        {
            throw new IllegalArgumentException("cannot create a UnmodifiableMutableMap for null");
        }
        return new UnmodifiableMutableMap<K, V>(MapAdapter.adapt(map));
    }
189159
def asDictionary(self):
        
        value = self._dict
        if value is None:
            template = {
                "hasM" : self._hasM,
                "hasZ" : self._hasZ,
                "paths" : [],
                "spatialReference" : self.spatialReference
            }
            for part in self._paths:
                lpart = []
                for pt in part:
                    lpart.append(pt.asList)
                template['paths'].append(lpart)
                del lpart
            self._dict = template
        return self._dict
176018
public static <K, V> Map<K, V> immutableMapCopy(Map<K, V> map) {
      if (map == null) return null;
      if (map.isEmpty()) return Collections.emptyMap();
      if (map.size() == 1) {
         Map.Entry<K, V> me = map.entrySet().iterator().next();
         return Collections.singletonMap(me.getKey(), me.getValue());
      }

      Map<? extends K, ? extends V> copy = ObjectDuplicator.duplicateMap(map);

      if (copy == null)
         copy = attemptCopyConstructor(map, Map.class);
      if (copy == null)
         copy = new HashMap<>(map);

      return new ImmutableMapWrapper<>(copy);
   }
796116
@Override
  public WriteLockedOffHeapHashMap<K, V> newInstance() {
    StorageEngine<? super K, ? super V> storageEngine = storageEngineFactory.newInstance();
    try {
      return new WriteLockedOffHeapHashMap<>(tableSource, storageEngine, tableSize);
    } catch (RuntimeException e) {
      storageEngine.destroy();
      throw e;
    }
  }
523778
public static <K, V> Map<K, V> createHashMap(int expectedMapSize) {
        final int initialCapacity = calculateInitialCapacity(expectedMapSize);
        return new HashMap<K, V>(initialCapacity, HASHMAP_DEFAULT_LOAD_FACTOR);
    }
1208396
public static <K, V> Xmap<K, V> create(Map<K, V> map) {
        Xmap<K, V> xmap = new Xmap<>();
        xmap.putAll(map);
        return xmap;
    }
1217317
@SuppressWarnings("unchecked") public <V> Map<String, V> asMap() {
		return (Map<String, V>) mapper().map();
	}
134919
Map<String, Object> serialize() {

		final Map<String, Object> map = new TreeMap<>();

		map.put(JsonSchema.KEY_DEFINITIONS, typeDefinitions.serialize());
		map.put(JsonSchema.KEY_METHODS, globalMethods.serialize());
		map.put(JsonSchema.KEY_ID, getId());

		return map;
	}
279412
public Map<String, Object> asMap() {
        Map<String, Object> map = new HashMap<>();
        Set<String> keys = columnNameToIdxMap.keySet();
        Iterator<String> iterator = keys.iterator();
        while (iterator.hasNext()) {
            String colum = iterator.next().toString();
            int index = columnNameToIdxMap.get(colum);
            map.put(colum, values[index]);
        }
        return map;
    }
994617
private Map<String, Class<?>> createPropertyMap(Class<?> clz) throws Exception
   {
      Map<String, Class<?>> result = new HashMap<>();

      for (Method m : clz.getMethods())
      {
         if (m.getName().startsWith("set"))
         {
            if (m.getReturnType().equals(Void.TYPE) &&
                m.getParameterCount() == 1 &&
                isSupported(m.getParameterTypes()[0]))
               result.put(m.getName().substring(3), m.getParameterTypes()[0]);
         }
      }
      
      return result;
   }
428458
protected final Dictionary createNgramDictionary(
      final ObjectStream<POSSample> aDictSamples, final int aNgramCutoff) {
    Dictionary ngramDict = null;
    if (aNgramCutoff != Flags.DEFAULT_DICT_CUTOFF) {
      System.err.print("Building ngram dictionary ... ");
      try {
        ngramDict = POSTaggerME
            .buildNGramDictionary(aDictSamples, aNgramCutoff);
        this.dictSamples.reset();
      } catch (final IOException e) {
        throw new TerminateToolException(-1,
            "IO error while building NGram Dictionary: " + e.getMessage(), e);
      }
      System.err.println("done");
    }
    return ngramDict;
  }
790826
protected Map<Character, List<Pair<FeaturePattern, FeatureReplacement>>> initMapping() {
		final Map<Character, List<Pair<FeaturePattern, FeatureReplacement>>> map = new TreeMap<>();
		if (!this.ruleReader.initializeConversions(map, this.context) && this.initializer != null) {
			this.initializer.initializeConversions((simpleName, source, target) -> {
				final char c = getKey(simpleName);
				if (c == FeaturePattern.ALL_PATTERN_CHAR) {
					for (int i = 'a'; i <= 'z'; ++i) {
						createMappingEntry(map, (char) i, source, target);
					}
				} else {
					createMappingEntry(map, c, source, target);
				}
			});
		}
		return map;
	}
91886
public static <K, V> Map<K, V> newHashMap(Map<? extends K, ? extends V> m) {
    return new HashMap<K, V>(m);
  }
186747
public Map<K, V> toMap() {
        Map<K, V> result = new HashMap<K, V>();
        result.put(key, value);
        return result;
    }
903152
static Map<String, String> valueAsMapOfStrings(Map<String, Object> map, Key key, Map<String, String> defaultValue) {
        Map<String, Object> castedDefaultValue = new HashMap<String, Object>();
        castedDefaultValue.putAll(defaultValue);

        Map<String, Object> uncastedResult = valueAsMap(map, key, castedDefaultValue);
        Map<String, String> castedResult = new HashMap<String, String>();
        for (Map.Entry<String, Object> entry : uncastedResult.entrySet()) {
            castedResult.put(entry.getKey(), entry.getValue() == null ? null : entry.getValue().toString());
        }
        return castedResult;
    }