Class DesignerIteratorUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.DesignerIteratorUtil
-
public final class DesignerIteratorUtil extends Object
- Since:
- 6.11.0
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> boolean
any(Iterator<? extends T> it, Predicate<? super T> predicate)
static <T> Iterable<T>
asReversed(List<T> lst)
static int
count(Iterator<?> it)
Counts the items in this iterator, exhausting it.static <T> Iterator<T>
iteratorFrom(T seed, Predicate<T> hasSuccessor, Function<T,T> successorFun, boolean includeSeed)
Gets an iterator with a successor fun.static <T> T
last(Iterator<T> ts)
static <T> Iterator<T>
reverse(Iterator<T> it)
static <T> Stream<T>
takeWhile(Stream<T> stream, Predicate<? super T> predicate)
static <T> Iterable<T>
toIterable(Iterator<T> it)
static <T> List<T>
toList(Iterator<T> it)
static <T> Stream<T>
toStream(Iterator<T> it)
-
-
-
Method Detail
-
last
public static <T> T last(Iterator<T> ts)
-
count
public static int count(Iterator<?> it)
Counts the items in this iterator, exhausting it.
-
iteratorFrom
public static <T> Iterator<T> iteratorFrom(T seed, Predicate<T> hasSuccessor, Function<T,T> successorFun, boolean includeSeed)
Gets an iterator with a successor fun.- Type Parameters:
T
- Type of values- Parameters:
seed
- Seed itemhasSuccessor
- Tests whether the seed / the last item output has a successorsuccessorFun
- Successor functionincludeSeed
- Whether to include the seed as the first item of the iterator- Returns:
- An iterator
-
-