public abstract class MultiMap<E,P,D> extends Object
| Constructor and Description |
|---|
MultiMap()
Creates an empty map
|
MultiMap(int initialSize)
Creates an empty map
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract D |
createDataInstance()
Creates a new instance of the data value.
|
D |
get(E el)
Gets the data for the given element and no pseudo-element
|
D |
get(E el,
P pseudo)
Gets the data for the given element and pseudo-element.
|
D |
getOrCreate(E el,
P pseudo)
Gets the data or creates an empty list if it does not exist yet.
|
boolean |
hasPseudo(E el,
P pseudo)
Checks if the given pseudo element is available for the given element
|
Set<E> |
keySet()
Gets all the keys (elements) of the main map.
|
Set<P> |
pseudoSet(E el)
Gets all the pseudo elements that are available for the given element.
|
void |
put(E el,
P pseudo,
D data)
Sets the data for the specified element and pseudo-element.
|
int |
size()
Obtains the size of the main map (where P is null)
|
public MultiMap()
public MultiMap(int initialSize)
protected abstract D createDataInstance()
getOrCreate(Object, Object).public int size()
public D get(E el, P pseudo)
el - the elementpseudo - a pseudo-element or null, if no pseudo-element is requiredpublic D get(E el)
el - the elementpublic D getOrCreate(E el, P pseudo)
el - the elementpseudo - a pseudo-element or null, if no pseudo-element is requiredpublic void put(E el, P pseudo, D data)
el - the element to which the data belongspseudo - a pseudo-element or null of none is requireddata - data to be setpublic Set<E> keySet()
public Set<P> pseudoSet(E el)
el - The given elementCopyright © 2014. All rights reserved.