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.
  • Method Details

    • getFirstMatchingCategory

      @Nullable default IngredientComponentCategoryType<T,M,?> getFirstMatchingCategory(M matchCondition)
      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

      default L getBestClassifiedCollection(M matchCondition)
      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

      default L getFirstSingleClassified()
      Returns:
      The first available classified collection-like.
    • removeInstance

      void removeInstance(L collection, I iterableInstance)
      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,?>,L> getClassifiedCollections()
      Returns:
      A mapping of all internal classified collections.