|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.tum.cs.commons.collections.HashedListMap<K,I>
public class HashedListMap<K,I>
This class defines a mapping from on item to a list of items.
| Constructor Summary | |
|---|---|
HashedListMap()
Create new hashed list map. |
|
HashedListMap(HashedListMap<K,I> other)
Copy constructor. |
|
HashedListMap(Map<K,List<I>> map)
Create new hashed list map with a specified map. |
|
| Method Summary | |
|---|---|
void |
add(K key,
I item)
Add an item to the list identified by a key. |
void |
addAll(HashedListMap<K,I> other)
Adds all elements from another hashed list map. |
void |
addAll(K key,
Collection<I> items)
Add all items to the list identified by a key. |
boolean |
areAllListsEmpty()
Checks if all lists stored in the map are empty. |
void |
clear()
Clear map. |
boolean |
containsList(K key)
Check if a list is present for a given key. |
List<I> |
createList(K key)
Create an empty list for a key. |
Set<K> |
getKeys()
Get keys. |
List<I> |
getList(K key)
Get list for key. |
List<I> |
getValues()
Return all values from all lists. |
Map<K,I[]> |
listsToArrays(Class<I> type)
Converts the HashedListMap to a map with arrays |
void |
removeAllLists(Collection<K> keys)
Removes the lists stored for a collection of keys |
void |
removeList(K key)
Removes the list stored for a key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HashedListMap()
public HashedListMap(Map<K,List<I>> map)
public HashedListMap(HashedListMap<K,I> other)
| Method Detail |
|---|
public List<I> createList(K key)
public List<I> getList(K key)
null
public void add(K key,
I item)
public void addAll(K key,
Collection<I> items)
public void addAll(HashedListMap<K,I> other)
public boolean containsList(K key)
public void removeList(K key)
public void removeAllLists(Collection<K> keys)
public Set<K> getKeys()
public List<I> getValues()
public boolean areAllListsEmpty()
getValues() returns an empty list.
public void clear()
public Map<K,I[]> listsToArrays(Class<I> type)
HashedListMap to a map with arrays
type - Type of the target array
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||