| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.util.collect.MultiList<E> |
A list of lists to be used as a fast-access multi-map for cases where the key is an integer index
ranging in a compact [0, N] range. Use with caution! if the input key range is sparse, it is
better to use a MultiMap.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
MultiList()
Create a new multi-list.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void | clear() | ||||||||||
| List<E> | get(int index) | ||||||||||
| List<E> | get(int index, boolean safe) | ||||||||||
| List<E> | getSafe(int index) | ||||||||||
| NavigableSet<Integer> | indexSet() | ||||||||||
| boolean | isEmpty() | ||||||||||
| int | put(int index, E value) | ||||||||||
| void | putAll(List<List<? extends E>> c) | ||||||||||
| void |
putMulti(int index, Collection<? extends E> values)
Add multiple elements mapped by the same key.
| ||||||||||
| List<E> | remove(int index) | ||||||||||
| boolean | removeValue(int index, E value) | ||||||||||
| int |
size()
Get the number of elements.
| ||||||||||
| String | toString() | ||||||||||
| Collection<E> | values() | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a new multi-list.
| safe | if true, an empty list of values is returned if the indexed bucket does not exist |
|---|
Add multiple elements mapped by the same key. Note that if an empty collection is provided, the entry for the provided key will not be be explicitly created.
Get the number of elements.