com.softicar.platform.common.container.map.list.IListMap 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.Collection;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
/**
* Map from a key to a {@link List} of values.
*
* @param
* the key class
* @param
* the values in the sets
* @author Oliver Richers
*/
public interface IListMap {
// -------------------- read-only -------------------- //
boolean containsKey(K key);
boolean isEmpty();
int size();
Set keySet();
Set>> entrySet();
Collection> values();
/**
* Returns the list of values for the given key.
*
* If no matching list exists yet, a new empty list is created and added to
* this map. You may use the returned list and add values to it. Those
* values will then be part of this map.
*
* @param key
* the key
* @return the matching list, never null
*/
List getList(K key);
/**
* Returns all values of all lists in this map.
*
* @return a list of all list values
*/
List getListsContent();
// -------------------- mutating -------------------- //
void clear();
List removeKey(K key);
void addToList(K key, V value);
void addAllToList(K key, Collection values);
}