# Class: com.pnfsoftware.jeb.util.collect.MultiList

A list of lists to be used as a fast\-access multi\-map for cases where the key is an integer index located in a compact \[0, N\] range. Use with caution: if the input key range is sparse, it is better to use a [MultiMap](MultiMap).

## Constructor: MultiList

Description: Create a new multi\-list.

## Method: clear

Description: Remove all buckets and values.

## Method: clear
- parameter: `index`, type: `int`
- return type: `java.util.List<E>`

Description: Clear a bucket. The bucket stays.
parameter: index: bucket index
return: the list of elements that were in the cleared bucket, possibly empty, never null

## Method: findAllElements
- parameter: `index`, type: `int`
- parameter: `check`, type: `java.util.function.Predicate<E>`
- return type: `java.util.List<E>`

Description: Find all elements in a bucket matching a predicate.
parameter: index: bucket index
parameter: check: predicate selecting elements
return: list of matching elements

## Method: findFirstElement
- parameter: `index`, type: `int`
- parameter: `check`, type: `java.util.function.Predicate<E>`
- return type: `E`

Description: Find the first element in a bucket matching a predicate.
parameter: index: bucket index
parameter: check: predicate selecting elements
return: first matching element, or null if none was found

## Method: get
- parameter: `index`, type: `int`
- return type: `java.util.List<E>`

Description: Retrieve the elements stored in an indexed bucket.
parameter: index: bucket index
return: a list, possibly empty, never null

## Method: indexSet
- return type: `java.util.NavigableSet<java.lang.Integer>`

Description: Retrieve the indices of non\-empty buckets.
return: navigable set of bucket indices

## Method: isEmpty
- return type: `boolean`

Description: Determine whether this multi\-list has no values.
return: true if no values are stored

## Method: put
- parameter: `index`, type: `int`
- parameter: `elt`, type: `E`
- return type: `int`

Description: Add an element to a bucket.
parameter: index: bucket index
parameter: elt: element to add
return: updated count of values in the bucket

## Method: putAll
- parameter: `colls`, type: `java.util.Collection<java.util.Collection<? extends E>>`

Description: Add all bucketed values.
parameter: colls: collections of values, in bucket order

## Method: putMulti
- parameter: `index`, type: `int`
- parameter: `values`, type: `java.util.Collection<? extends E>`

Description: Add multiple elements mapped by the same key.
parameter: index: bucket index
parameter: values: values to add

## Method: remove
- parameter: `index`, type: `int`
- return type: `java.util.List<E>`

Description: Remove a bucket and shift subsequent bucket entries. Eg, removing the bucket at index 10 means that buckets previously at indexes 11, 12, ..., N will be at indexes 10, 11, ..., N\-1. **Mind the unusual semantic of this operation.**
parameter: index: bucket index
return: the list of elements that were in the removed bucket, possibly empty, never null

## Method: removeElement
- parameter: `index`, type: `int`
- parameter: `value`, type: `E`
- return type: `boolean`

Description: Remove an element from a bucket.
parameter: index: bucket index
parameter: value: the element to be removed
return: true if the element was removed

## Method: removeMultipleElements
- parameter: `index`, type: `int`
- parameter: `check`, type: `java.util.function.Predicate<E>`
- return type: `int`

Description: Remove elements from a bucket.
parameter: index: bucket index
parameter: check: predicate selecting elements to remove
return: the number of elements removed

## Method: size
- return type: `int`

Description: Get the total number of elements stored in all the buckets.
return: total number of elements

## Method: toString
- return type: `java.lang.String`


## Method: values
- return type: `java.util.Collection<E>`

Description: Retrieve all values.
return: read\-only collection of values

