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

com.softicar.platform.common.container.map.list.ListHashMap Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.container.map.list;

import java.util.HashMap;
import java.util.List;

/**
 * Map from a key to a list of values. Unlike {@link ListTreeMap}, here are
 * null-values permitted
 * 
 * @param 
 *            the key class
 * @param 
 *            the values in the sets
 * @author Boris Schaa
 * @author Oliver Richers
 */
public class ListHashMap extends AbstractListMap {

	public ListHashMap() {

		super(new HashMap>());
	}

	@Override
	public String toString() {

		String result = "[";
		for (final K k: keySet()) {
			result += k;
			result += " [";
			for (final V v: getList(k)) {
				result += "[" + v + "]";
			}
			result += "] ";
		}
		result += "] ";

		return result;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy