Class ListIteratorUtils

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

public class ListIteratorUtils extends Object
  • Constructor Details

    • ListIteratorUtils

      public ListIteratorUtils()
  • Method Details

    • distanceToNext

      public static <T> Map.Entry<Integer,T> distanceToNext(ListIterator<T> listIterator, Predicate<? super T> predicate)
      Return the number of .next() invocations needed to obtain the next item. A result of 0 indicates that no such item exists.
      Type Parameters:
      T -
      Parameters:
      listIterator -
      predicate -
      Returns:
    • distanceToPrevious

      public static <T> Map.Entry<Integer,T> distanceToPrevious(ListIterator<T> listIterator, Predicate<? super T> predicate)
    • repeatPrevious

      public static int repeatPrevious(ListIterator<?> listIterator, int n)
      Attempt to invoke .previous up to 'n' times and abort if .hasPrevious is false. Returns the number of actual invocations.
      Parameters:
      listIterator -
      n -
      Returns:
    • repeatNext

      public static int repeatNext(ListIterator<?> listIterator, int n)
    • getItemNext

      public static <T> T getItemNext(ListIterator<T> listIterator, int n)
    • getItemPrevious

      public static <T> T getItemPrevious(ListIterator<T> listIterator, int n)