public class

MultiList

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.collect.MultiList<E>

Class Overview

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.

Summary

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

Public Constructors

public MultiList ()

Create a new multi-list.

Public Methods

public void clear ()

public List<E> get (int index)

public List<E> get (int index, boolean safe)

Parameters
safe if true, an empty list of values is returned if the indexed bucket does not exist

public List<E> getSafe (int index)

public NavigableSet<Integer> indexSet ()

public boolean isEmpty ()

public int put (int index, E value)

public void putAll (List<List<? extends E>> c)

public void putMulti (int index, Collection<? extends E> values)

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.

public List<E> remove (int index)

public boolean removeValue (int index, E value)

public int size ()

Get the number of elements.

public String toString ()

public Collection<E> values ()