Class IterableUtils

java.lang.Object
org.aksw.commons.collections.IterableUtils

public class IterableUtils extends Object
  • Constructor Details

    • IterableUtils

      public IterableUtils()
  • Method Details

    • expectOneItem

      @Deprecated public static <T> T expectOneItem(Iterable<T> iterable)
      Deprecated.
    • expectZeroOrOneItems

      @Deprecated public static <T> T expectZeroOrOneItems(Iterable<T> iterable)
      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

      public static boolean equalsByReference(Iterable<?> a, Iterable<?> b)
    • compare

      public static <X> int compare(Iterable<? extends X> a, Iterable<? extends X> b, Comparator<X> comparator)