A utility class for Iterator.
More...
|
| static< T, S > Stream< S > | asFilteredStream (Iterator< T > iterator, Class< S > cls) |
| | Given an iterator of type T, turn it into a stream containing only the instances of the given class of type S.
|
| static< T > Iterable< T > | asIterable (Iterator< T > iterator) |
| | Function to get Iterable from Iterator.
|
| static< T > Stream< T > | asStream (Iterator< T > iterator) |
| | Turn an iterator into a sequential stream.
|
| static< T > Stream< T > | asStream (Iterator< T > iterator, boolean parallel) |
| | Turn an iterator into a sequential or parallel stream.
|
A utility class for Iterator.
- Author
- Marten Lohstroh
-
Hokeun Kim
◆ asFilteredStream()
| static< T, S > Stream< S > org.lflang.util.IteratorUtil.asFilteredStream |
( |
Iterator< T > | iterator, |
|
|
Class< S > | cls ) |
|
static |
Given an iterator of type T, turn it into a stream containing only the instances of the given class of type S.
- Parameters
-
| <T> | The type of elements the iterator iterates over. |
| <S> | The type of class to filter out instance of. |
| iterator | An iterator of type T. |
| cls | A given class of type S. |
- Returns
- A filtered stream that only has in it instances of the given class.
◆ asIterable()
| static< T > Iterable< T > org.lflang.util.IteratorUtil.asIterable |
( |
Iterator< T > | iterator | ) |
|
|
static |
Function to get Iterable from Iterator.
- Parameters
-
| iterator | The iterator to get an iterable from. |
- Returns
- An iterable.
◆ asStream() [1/2]
| static< T > Stream< T > org.lflang.util.IteratorUtil.asStream |
( |
Iterator< T > | iterator | ) |
|
|
static |
Turn an iterator into a sequential stream.
- Parameters
-
| iterator | The iterator to create a sequential stream for. |
- Returns
- A stream.
◆ asStream() [2/2]
| static< T > Stream< T > org.lflang.util.IteratorUtil.asStream |
( |
Iterator< T > | iterator, |
|
|
boolean | parallel ) |
|
static |
Turn an iterator into a sequential or parallel stream.
- Parameters
-
| iterator | The iterator to create a stream for. |
| parallel | Whether or not the stream should be parallel. |
- Returns
- A stream.
The documentation for this class was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/util/IteratorUtil.java