Class MixedIngredientsAdapter
java.lang.Object
org.cyclops.commoncapabilities.api.ingredient.MixedIngredientsAdapter
- All Implemented Interfaces:
Comparable<IMixedIngredients>
,IMixedIngredients
- Direct Known Subclasses:
MixedIngredients
Abstract implementation of mixed ingredients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
intcompareCollection
(Collection<? super T> a, Collection<? super T> b) Compare two collections with comparable elements.static <T> int
compareCollection
(Collection<? super T> a, Collection<? super T> b, Comparator<T> comparator) Compare two collections with a custom comparator.int
compareTo
(IMixedIngredients that) boolean
int
hashCode()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cyclops.commoncapabilities.api.ingredient.IMixedIngredients
containsAll, getComponents, getFirstNonEmpty, getInstances, isEmpty
-
Constructor Details
-
MixedIngredientsAdapter
public MixedIngredientsAdapter()
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<IMixedIngredients>
-
compareCollection
public static <T extends Comparable<T>> int compareCollection(Collection<? super T> a, Collection<? super T> b) Compare two collections with comparable elements.- Type Parameters:
T
- The type of the elements.- Parameters:
a
- A first collection.b
- A second collection.- Returns:
- The comparator value.
-
compareCollection
public static <T> int compareCollection(Collection<? super T> a, Collection<? super T> b, Comparator<T> comparator) Compare two collections with a custom comparator.- Type Parameters:
T
- The type of the elements.- Parameters:
a
- A first collection.b
- A second collection.comparator
- The element comparator.- Returns:
- The comparator value.
-