All Downloads are FREE. Search and download functionalities are using the official Maven repository.

se.culvertsoft.mgen.javapack.util.MapMaker Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package se.culvertsoft.mgen.javapack.util;

import java.util.HashMap;

/**
 * Internal utility class for creating maps with contents in one line. Intended
 * to be used only in generated code.
 * 
 * @param 
 *            The key type of the map to be made
 * 
 * @param 
 *            The value type of the map to be made
 */
public class MapMaker {

	public MapMaker(final int n) {
		m_map = new HashMap(n);
	}

	public MapMaker put(final K key, final V value) {
		m_map.put(key, value);
		return this;
	}

	public HashMap make() {
		return m_map;
	}

	private final HashMap m_map;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy