C - JComponent typeE - List data typepublic class WeakComponentDataList<C extends JComponent,E> extends WeakComponentData<C,List<E>>
WeakComponentData that provides convenience methods for List-type data usage.
Note that Lists kept within the JComponent would never have null values.components, key| Constructor and Description |
|---|
WeakComponentDataList(String key,
int initialCapacity)
Constructs new
WeakComponentDataList. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(C component,
E data)
Stores data for the specified
JComponent. |
boolean |
allDataMatch(BiPredicate<C,E> predicate)
Returns whether or not all of the stored data pieces are accepted by specified
BiPredicate. |
boolean |
allDataMatch(C component,
BiPredicate<C,E> predicate)
Returns whether or not all of the data pieces stored for specified
JComponent are accepted by BiPredicate. |
boolean |
anyDataMatch(BiPredicate<C,E> predicate)
Returns whether or not at least one of the stored data pieces is accepted by specified
BiPredicate. |
boolean |
anyDataMatch(C component,
BiPredicate<C,E> predicate)
Returns whether or not at least one of the data pieces stored for specified
JComponent is accepted by BiPredicate. |
boolean |
containsData(C component)
Returns whether or not
JComponent has any data of this kind stored within. |
boolean |
containsData(C component,
E data)
Returns whether or not
JComponent has specified data stored within. |
void |
forEachData(BiConsumer<C,E> consumer)
Provides every stored data piece into specified
BiConsumer. |
void |
forEachData(C component,
BiConsumer<C,E> consumer)
Provides data pieces stored for specified
JComponent into BiConsumer. |
boolean |
noneDataMatch(BiPredicate<C,E> predicate)
Returns whether or not none of the stored data pieces are accepted by specified
BiPredicate. |
boolean |
noneDataMatch(C component,
BiPredicate<C,E> predicate)
Returns whether or not none of the data pieces stored for specified
JComponent are accepted by BiPredicate. |
void |
remove(C component,
E data)
Removes data from the specified
JComponent. |
void |
remove(C component,
E data,
BiConsumer<C,E> removedDataConsumer)
Removes data from the specified
JComponent. |
int |
size(C component)
Returns size of data list stored within
JComponent. |
public WeakComponentDataList(@NotNull String key, int initialCapacity)
WeakComponentDataList.key - key used to place data list within JComponentinitialCapacity - initial capacity for the Set of JComponentspublic int size(@NotNull C component)
JComponent.component - JComponent to check data inJComponentpublic boolean containsData(@NotNull C component)
JComponent has any data of this kind stored within.component - JComponent to check data intrue if JComponent has any data of this kind stored within, false otherwisepublic boolean containsData(@NotNull C component, @NotNull E data)
JComponent has specified data stored within.component - JComponent to check data indata - data to findtrue if JComponent has specified data stored within, false otherwisepublic void add(@NotNull C component, @NotNull E data)
JComponent.component - JComponent to store data indata - data to storepublic void remove(@NotNull C component, @NotNull E data)
JComponent.component - JComponent to remove data fromdata - data to removepublic void remove(@NotNull C component, @NotNull E data, @NotNull BiConsumer<C,E> removedDataConsumer)
JComponent.component - JComponent to remove data fromdata - data to removeremovedDataConsumer - BiConsumer for removed datapublic void forEachData(@NotNull BiConsumer<C,E> consumer)
BiConsumer.consumer - BiConsumer for JComponent and datapublic void forEachData(@NotNull C component, @NotNull BiConsumer<C,E> consumer)
JComponent into BiConsumer.component - JComponent to provide data pieces forconsumer - BiConsumer for JComponent and datapublic boolean anyDataMatch(@NotNull BiPredicate<C,E> predicate)
BiPredicate.predicate - BiPredicate for JComponent and datatrue if at least one of the data pieces is accepted by specified BiPredicate, false otherwisepublic boolean anyDataMatch(@NotNull C component, @NotNull BiPredicate<C,E> predicate)
JComponent is accepted by BiPredicate.component - JComponent to match data pieces forpredicate - BiPredicate for JComponent and datatrue if at least one of the data pieces is accepted by BiPredicate, false otherwisepublic boolean allDataMatch(@NotNull BiPredicate<C,E> predicate)
BiPredicate.predicate - BiPredicate for JComponent and datatrue if all of the data pieces are accepted by specified BiPredicate, false otherwisepublic boolean allDataMatch(@NotNull C component, @NotNull BiPredicate<C,E> predicate)
JComponent are accepted by BiPredicate.component - JComponent to match data pieces forpredicate - BiPredicate for JComponent and datatrue if all of the data pieces are accepted by BiPredicate, false otherwisepublic boolean noneDataMatch(@NotNull BiPredicate<C,E> predicate)
BiPredicate.predicate - BiPredicate for JComponent and datatrue if none of the data pieces are accepted by specified BiPredicate, false otherwisepublic boolean noneDataMatch(@NotNull C component, @NotNull BiPredicate<C,E> predicate)
JComponent are accepted by BiPredicate.component - JComponent to match data pieces forpredicate - BiPredicate for JComponent and datatrue if none of the data pieces are accepted by specified BiPredicate, false otherwiseCopyright © 2020. All rights reserved.