com.softicar.platform.common.container.map.list.ListHashMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
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;
}
}