Package org.aksw.commons.collections
Class ListIteratorUtils
java.lang.Object
org.aksw.commons.collections.ListIteratorUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondistanceToNext(ListIterator<T> listIterator, Predicate<? super T> predicate) Return the number of .next() invocations needed to obtain the next item.distanceToPrevious(ListIterator<T> listIterator, Predicate<? super T> predicate) static <T> TgetItemNext(ListIterator<T> listIterator, int n) static <T> TgetItemPrevious(ListIterator<T> listIterator, int n) static intrepeatNext(ListIterator<?> listIterator, int n) static intrepeatPrevious(ListIterator<?> listIterator, int n) Attempt to invoke .previous up to 'n' times and abort if .hasPrevious is false.
-
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
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
-
getItemNext
-
getItemPrevious
-