Class IngredientCollectionCollectionAdapter<T,M,C extends Collection<T>>
java.lang.Object
org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionAdapter<T,M>
org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionCollectionAdapter<T,M,C>
- Type Parameters:
T
- The instance type.M
- The matching condition parameter.C
- The type of inner collection.
- All Implemented Interfaces:
Iterable<T>
,IIngredientCollection<T,
,M> IIngredientCollectionLike<T,
,M, T> IIngredientCollectionMutable<T,
M>
- Direct Known Subclasses:
IngredientList
public abstract class IngredientCollectionCollectionAdapter<T,M,C extends Collection<T>>
extends IngredientCollectionAdapter<T,M>
implements IIngredientCollectionMutable<T,M>
An abstract collection that stores instances directly in a regular
Collection
.-
Constructor Summary
ConstructorDescriptionIngredientCollectionCollectionAdapter
(IngredientComponent<T, M> component, C collection) -
Method Summary
Methods inherited from class org.cyclops.cyclopscore.ingredient.collection.IngredientCollectionAdapter
contains, contains, count, getComponent, hashCode, iterator, remove, removeAll, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollection
contains, contains, containsAll, containsAll, count, iterator, parallelStream, spliterator, stream, toArray
Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike
equals, getComponent, hashCode, isEmpty, toString
-
Constructor Details
-
IngredientCollectionCollectionAdapter
-
-
Method Details
-
getCollection
-
add
Description copied from interface:IIngredientCollectionMutable
Add the given instance to the collection.- Specified by:
add
in interfaceIIngredientCollectionMutable<T,
M> - Parameters:
instance
- An instance.- Returns:
- If the collection was changed due to this addition. This can be false in the case of sets in which each instance can only exists once.
-
clear
public void clear()Description copied from interface:IIngredientCollectionMutable
Clears this collection of all instances.- Specified by:
clear
in interfaceIIngredientCollectionMutable<T,
M>
-
size
public int size()- Specified by:
size
in interfaceIIngredientCollectionLike<T,
M, C extends Collection<T>> - Returns:
- The number of instances contained in this collection.
-
iterator
-