Package org.aksw.commons.collections
Class IterableUtils
java.lang.Object
org.aksw.commons.collections.IterableUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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 <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)
-