Class IterableUtils
java.lang.Object
org.aksw.commons.collections.IterableUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <X> intcompare(Iterable<? extends X> a, Iterable<? extends X> b, Comparator<X> comparator) static <T> intcompareByLengthThenItems(Iterable<? extends T> a, Iterable<? extends T> b, Comparator<? super T> itemComparator) static <T> intcompareIterablesOfEqualLength(Iterable<? extends T> a, Iterable<? extends T> b, Comparator<? super T> itemComparator) Will only compare as many items as there are in the shorter iterablestatic booleanequalsByReference(Iterable<?> a, Iterable<?> b) static <T> TexpectOneItem(Iterable<T> iterable) Deprecated.static <T> TexpectZeroOrOneItems(Iterable<T> iterable) Deprecated.static <T> Comparator<? super Iterable<? extends T>> newComparatorForIterablesOfEqualLength(Comparator<? super T> itemComparator) Will only compare as many items as there are in the shorter iterable
-
Constructor Details
-
IterableUtils
public IterableUtils()
-
-
Method Details
-
expectOneItem
Deprecated. -
expectZeroOrOneItems
Deprecated. -
newComparatorForIterablesOfEqualLength
public static <T> Comparator<? super Iterable<? extends T>> newComparatorForIterablesOfEqualLength(Comparator<? super T> itemComparator) Will only compare as many items as there are in the shorter iterable- Parameters:
itemComparator-- Returns:
-
compareIterablesOfEqualLength
public static <T> int compareIterablesOfEqualLength(Iterable<? extends T> a, Iterable<? extends T> b, Comparator<? super T> itemComparator) Will only compare as many items as there are in the shorter iterable- Parameters:
a-b-itemComparator-- Returns:
-
compareByLengthThenItems
public static <T> int compareByLengthThenItems(Iterable<? extends T> a, Iterable<? extends T> b, Comparator<? super T> itemComparator) -
equalsByReference
-
compare
public static <X> int compare(Iterable<? extends X> a, Iterable<? extends X> b, Comparator<X> comparator)
-