E - the type of the elements in the containerC - the type of the container@FunctionalInterface
public interface AddFunction<E,C>
| Modifier and Type | Method | Description |
|---|---|---|
void |
apply(C container,
int index,
E element) |
Adds an element to the given container.
|
void apply(C container, int index, E element)
This method is guaranteed to be called sequentially in the order of indices from 0 to size - 1. The index parameter is only here to support array-like implementations, but collections may ignore it.
container - the container to add the element toindex - the index at which the element should be addedelement - the element to add