Class FilteredIngredientCollectionIterator<T,M>

java.lang.Object
org.cyclops.cyclopscore.ingredient.collection.FilteredIngredientCollectionIterator<T,M>
Type Parameters:
T - The instance type.
M - The matching condition parameter.
All Implemented Interfaces:
Iterator<T>

public class FilteredIngredientCollectionIterator<T,M> extends Object implements Iterator<T>
An iterator that filters over an instances collection based on an instance with a match condition.
  • Constructor Details

    • FilteredIngredientCollectionIterator

      public FilteredIngredientCollectionIterator(Iterable<T> iterable, IIngredientMatcher<T,M> matcher, T instance, M matchCondition)
      Create a new instance.
      Parameters:
      iterable - An iterable with instances.
      matcher - A matcher for the type of instances.
      instance - An instance to match.
      matchCondition - A match condition to filter by.
    • FilteredIngredientCollectionIterator

      public FilteredIngredientCollectionIterator(Iterator<T> iterator, IIngredientMatcher<T,M> matcher, T instance, M matchCondition)
      Create a new instance.
      Parameters:
      iterator - An iterator with instances.
      matcher - A matcher for the type of instances.
      instance - An instance to match.
      matchCondition - A match condition to filter by.
  • Method Details

    • findNext

      protected T findNext()
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>