Interface StringSplitter.Async
- All Superinterfaces:
Function<String,,List<String>> StringSplitter
- All Known Implementing Classes:
StringSplitter.Shell
- Enclosing interface:
- StringSplitter
A splitter that is capable of processing the split in an asynchronous manner.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIterator that splits elements lazily on demand during traversal.Nested classes/interfaces inherited from interface dev.sympho.modular_commands.utils.StringSplitter
StringSplitter.Async, StringSplitter.Shell -
Method Summary
Modifier and TypeMethodDescriptiondefault StringSplitter.Async.IteratorCreates an empty iterator for this splitter.default StringSplitter.Async.IteratorCreates a smart iterator that iterates over the components obtained by splitting the given raw string.Splits the given string into components.splitAsync(String raw) Splits the given string into components.default Spliterator<String>spliterate(String raw) Creates a spliterator that iterates over the components obtained by splitting the given raw string.splitStream(String raw) Creates a stream that contains over the components obtained by splitting the given raw string.Takes the next element from the current state.Methods inherited from interface dev.sympho.modular_commands.utils.StringSplitter
apply, delimiter
-
Method Details
-
takeNext
Takes the next element from the current state.- Parameters:
state- The current processing state.sink- The sink to send the next element into.- Returns:
- The new state.
-
split
Description copied from interface:StringSplitterSplits the given string into components.- Specified by:
splitin interfaceStringSplitter- Parameters:
raw- The string to split.- Returns:
- The split components.
-
splitAsync
Splits the given string into components. Splitting is performed asynchronously as requests are received from downstream.- Parameters:
raw- The string to split.- Returns:
- The split components.
-
iterate
Description copied from interface:StringSplitterCreates a smart iterator that iterates over the components obtained by splitting the given raw string. The returned iterator is functionally equivalent to callingSmartIterator.from(List)on the result ofStringSplitter.split(String), but may (depending on implementation) split components lazily on demand.- Specified by:
iteratein interfaceStringSplitter- Parameters:
raw- The string to split.- Returns:
- A smart iterator over the split components.
-
spliterate
Creates a spliterator that iterates over the components obtained by splitting the given raw string. The returned iterator is functionally equivalent to callingList.spliterator()on the result ofsplit(String), but splits components lazily on demand.- Parameters:
raw- The string to split.- Returns:
- A spliterator over the split components.
-
splitStream
Creates a stream that contains over the components obtained by splitting the given raw string. The returned iterator is functionally equivalent to callingCollection.stream()on the result ofsplit(String), but splits components lazily on demand.- Parameters:
raw- The string to split.- Returns:
- A stream of the split components.
-
emptyIterator
Creates an empty iterator for this splitter.- Specified by:
emptyIteratorin interfaceStringSplitter- Returns:
- The iterator.
-