Interface IIngredientCollectionLikeMultiClassifiedTrait<T,M,I,L extends IIngredientCollectionLike<T,M,I>>
- Type Parameters:
T- The instance type.M- The matching condition parameter.I- The type that can be iterated over. This is typically just T.L- The collection-like type that is being used to store classified partitions.
- All Superinterfaces:
IIngredientCollectionLike<T,,M, I> Iterable<I>
- All Known Implementing Classes:
IngredientCollectionMultiClassified,IngredientMapMultiClassified
public interface IIngredientCollectionLikeMultiClassifiedTrait<T,M,I,L extends IIngredientCollectionLike<T,M,I>>
extends IIngredientCollectionLike<T,M,I>
An interface-based trait for collections that have a multi-level classification,
which classify instances in smaller collections based on all category type of a component type.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classIIngredientCollectionLikeMultiClassifiedTrait.RemoveCallbackIterator<T,M, I, L extends IIngredientCollectionLike<T, M, I>> -
Method Summary
Modifier and TypeMethodDescriptiondefault LgetBestClassifiedCollection(M matchCondition) Get the best matching classified collection-like for the given match condition.default IngredientComponentCategoryType<T, M, ?> getFirstMatchingCategory(M matchCondition) Get the first category type that applies to the given match condition.default LvoidremoveInstance(L collection, I iterableInstance) Remove the given instance from the given collection-like.Methods inherited from interface org.cyclops.cyclopscore.ingredient.collection.IIngredientCollectionLike
equals, getComponent, hashCode, isEmpty, iterator, size, toStringMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getFirstMatchingCategory
Get the first category type that applies to the given match condition.- Parameters:
matchCondition- A match condition.- Returns:
- The first match condition, or null if the match condition applies to all.
-
getBestClassifiedCollection
Get the best matching classified collection-like for the given match condition.- Parameters:
matchCondition- A match condition.- Returns:
- The best matchin classified collection-like.
-
getFirstSingleClassified
- Returns:
- The first available classified collection-like.
-
removeInstance
Remove the given instance from the given collection-like. This is used internally for iteration purposes.- Parameters:
collection- A collection-like.iterableInstance- An iterator instance.
-
getClassifiedCollections
Map<IngredientComponentCategoryType<T,M, getClassifiedCollections()?>, L> - Returns:
- A mapping of all internal classified collections.
-