Uses of Interface
io.datarouter.scanner.Scanner
-
Uses of Scanner in io.datarouter.scanner
Classes in io.datarouter.scanner that implement Scanner Modifier and Type Class Description classAdvanceUntilScanner<T>classAdvanceWhileScanner<T>classArrayScanner<T>classBaseLinkedScanner<T,R>Subclasses do not have to worry about closing the input scanner.classBaseScanner<T>Simple Scanners can extend this to avoid declaring the "current" field and "getCurrent" methodclassBatchingScanner<T>classCollatingScanner<T>classComparableScanner<T>classConcatenatingScanner<T>classDeduplicatingScanner<T,R>classDistinctScanner<T,R>classEachScanner<T>classEmptyScanner<T>classFilteringScanner<T>classGeneratingScanner<T>classIteratingScanner<T>classIteratorScanner<T>classLimitingScanner<T>classMappingScanner<T,R>classNaturalSortingScanner<T>classObjectScanner<T>classPagingScanner<K,T>Base class for things that page through results by passing the last item as an exclusive start key for the next pageclassParallelMappingScanner<T,R>classPrefetchingScanner<T>classRandomAccessScanner<T>Avoid an intermediate Iterator when scanning a List with RandomAccess layout.classRetainingScanner<T>classSamplingScanner<T>classShufflingScanner<T>classSortingScanner<T>classSplittingScanner<T,R>classSteppingScanner<T>classStreamScanner<T>Fields in io.datarouter.scanner declared as Scanner Modifier and Type Field Description protected Scanner<T>BaseLinkedScanner. inputMethods in io.datarouter.scanner that return Scanner Modifier and Type Method Description default Scanner<T>Scanner. advanceUntil(Predicate<? super T> predicate)Stop the scanner when the predicate matches, excluding the item that caused it to stop.default Scanner<T>Scanner. advanceWhile(Predicate<? super T> predicate)Stop the scanner when the predicated fails to match, excluding the item that caused it to stop.default Scanner<T>Scanner. append(Scanner<T> scanner)Concats the provided Scanner after the current Scanner.default Scanner<T>Scanner. append(Iterable<T> iterable)Concats the provided Iterable items after the current Scanner.default Scanner<T>Scanner. append(T... items)Concats the provided array items after the current Scanner.default Scanner<List<T>>Scanner. batch(int batchSize)default <R> Scanner<R>Scanner. collate(Function<? super T,Scanner<R>> mapper)Similar to the merge phase of a merge sort, assuming the input Scanners are sorted.default <R> Scanner<R>Scanner. collate(Function<? super T,Scanner<R>> mapper, Comparator<? super R> comparator)Similar to the merge phase of a merge sort, assuming the input Scanners are sorted.static <T> Scanner<T>Scanner. concat(Scanner<T>... scanners)Combine the items from multiple Scanners into a single Scanner.static <T> Scanner<T>Scanner. concat(Iterable<T>... iterables)Combine the items from multiple Iterables into a single Scanner.default <R> Scanner<R>Scanner. concat(Function<? super T,Scanner<R>> mapToScanner)Combine the items from multiple Scanners into a single Scanner.default <R> Scanner<R>Scanner. concatIter(Function<? super T,Iterable<R>> mapToIterable)Combine the items from multiple Iterables into a single Scanner.default Scanner<T>Scanner. deduplicate()Skips consecutive duplicates.default Scanner<T>Scanner. deduplicateBy(Function<T,?> mapper)Skips items where the mapper outputs the same value as the previous item.default Scanner<T>Scanner. distinct()default Scanner<T>Scanner. distinctBy(Function<T,?> mapper)Scanner<T>ParallelScanner. each(Consumer<? super T> consumer)default Scanner<T>Scanner. each(Consumer<? super T> consumer)Calls Consumer::accept on each item.static <T> Scanner<T>Scanner. empty()Scanner<T>ParallelScanner. exclude(Predicate<? super T> predicate)default Scanner<T>Scanner. exclude(Predicate<? super T> predicate)Skips items where the Predicate returns true.default Scanner<T>Scanner. flush(Consumer<List<T>> consumer)static <T> Scanner<T>ScannerTool. flush(Scanner<T> scanner, Consumer<List<T>> consumer)static <T> Scanner<T>Scanner. generate(Supplier<T> supplier)Scanner<T>ParallelScanner. include(Predicate<? super T> predicate)default Scanner<T>Scanner. include(Predicate<? super T> predicate)Skips items where the Predicate returns false.static <T> Scanner<T>Scanner. iterate(T seed, UnaryOperator<T> unaryOperator)Generate a sequence where each item is calculated off the one before it.default Scanner<T>Scanner. limit(long limit)Ends the Scanner when the limit has been reached.default <R> Scanner<R>Scanner. link(Function<Scanner<T>,BaseLinkedScanner<T,R>> scannerBuilder)A caller can extend BaseLinkedScanner, which has exception handling logic, and fluently include it in the Scanner pipeline.<R> Scanner<R>ParallelScanner. map(Function<? super T,? extends R> mapper)default <R> Scanner<R>Scanner. map(Function<? super T,? extends R> mapper)For each input item, outputs the result of Function::apply.static <T> Scanner<T>ArrayScanner. of(T[] array)static <T> Scanner<T>IterableScanner. of(Iterable<T> iterable)static <T> Scanner<T>IteratorScanner. of(Iterator<T> iterator)static <T> Scanner<T>ObjectScanner. of(T object)static <T> Scanner<T>OptionalScanner. of(Optional<T> optional)static <T> Scanner<T>RandomAccessScanner. of(List<T> list)static <T> Scanner<T>Scanner. of(Iterable<T> iterable)Create a Scanner of items in the Iterable.static <T> Scanner<T>Scanner. of(Iterator<T> iterator)Create a Scanner of items in the Iterator.static <T> Scanner<T>Scanner. of(Stream<T> stream)Create a Scanner of items in the Stream.static <T> Scanner<T>Scanner. of(T object)Convert an Object into a Scanner.static <T> Scanner<T>Scanner. of(T... array)Create a Scanner of items in the array.static <T> Scanner<T>StreamScanner. of(Stream<T> stream)static <T> Scanner<T>IterableScanner. ofNullable(Iterable<T> iterable)static <T> Scanner<T>ObjectScanner. ofNullable(T object)static <T> Scanner<T>Scanner. ofNullable(T object)Convert an Object into a Scanner if non-null.default Scanner<T>Scanner. prefetch(ExecutorService exec, int batchSize)default Scanner<RetainingGroup<T>>Scanner. retain(int retaining)For retaining a window of N previous items.default Scanner<T>Scanner. sample(long sampleSize, boolean includeLast)Return every Nth item.default Scanner<T>Scanner. shuffle()static <T> Scanner<T>EmptyScanner. singleton()default Scanner<T>Scanner. skip(long numToSkip)Skip the leading items from the Scanner.static <T> Scanner<T>ScannerTool. skip(Scanner<T> scanner, long numToSkip)default Scanner<T>Scanner. sorted()default Scanner<T>Scanner. sorted(Comparator<? super T> comparator)default Scanner<Scanner<T>>Scanner. splitBy(Function<T,?> mapper)Applies the Function to each item in the Scanner, returning a new Scanner each time the mapped value changes.Methods in io.datarouter.scanner that return types with arguments of type Scanner Modifier and Type Method Description static <T, K> Function<Scanner<T>,Map<K,List<T>>>ScannerToGroups. of(Function<T,K> keyFunction)static <T, K, V> Function<Scanner<T>,Map<K,List<V>>>ScannerToGroups. of(Function<T,K> keyFunction, Function<T,V> valueFunction)static <T, K, V, M extends Map<K, List<V>>>
Function<Scanner<T>,M>ScannerToGroups. of(Function<T,K> keyFunction, Function<T,V> valueFunction, Supplier<M> mapSupplier)static <T, K, V, C extends Collection<V>, M extends Map<K, C>>
Function<Scanner<T>,M>ScannerToGroups. of(Function<T,K> keyFunction, Function<T,V> valueFunction, Supplier<M> mapSupplier, Supplier<C> collectionSupplier)static <T, K> Function<Scanner<T>,Map<K,T>>ScannerToMap. of(Function<T,K> keyFunction)static <T, K, V> Function<Scanner<T>,Map<K,V>>ScannerToMap. of(Function<T,K> keyFunction, Function<T,V> valueFunction)static <T, K, V> Function<Scanner<T>,Map<K,V>>ScannerToMap. of(Function<T,K> keyFunction, Function<T,V> valueFunction, ScannerToMap.Replace replacePolicy)static <T, K, V> Function<Scanner<T>,Map<K,V>>ScannerToMap. of(Function<T,K> keyFunction, Function<T,V> valueFunction, BinaryOperator<V> mergeFunction)static <T, K, V, M extends Map<K, V>>
Function<Scanner<T>,M>ScannerToMap. ofSupplied(Function<T,K> keyFunction, Function<T,V> valueFunction, ScannerToMap.Replace replacePolicy, Supplier<M> mapSupplier)static <T, K, V, M extends Map<K, V>>
Function<Scanner<T>,M>ScannerToMap. ofSupplied(Function<T,K> keyFunction, Function<T,V> valueFunction, BinaryOperator<V> mergeFunction, Supplier<M> mapSupplier)static <T, K, V, M extends Map<K, V>>
Function<Scanner<T>,M>ScannerToMap. ofSupplied(Function<T,K> keyFunction, Function<T,V> valueFunction, Supplier<M> mapSupplier)static <T, K, M extends Map<K, T>>
Function<Scanner<T>,M>ScannerToMap. ofSupplied(Function<T,K> keyFunction, Supplier<M> mapSupplier)default Scanner<Scanner<T>>Scanner. splitBy(Function<T,?> mapper)Applies the Function to each item in the Scanner, returning a new Scanner each time the mapped value changes.Methods in io.datarouter.scanner with parameters of type Scanner Modifier and Type Method Description static <T> booleanScannerTool. allMatch(Scanner<T> scanner, Predicate<? super T> predicate)static <T> booleanScannerTool. anyMatch(Scanner<T> scanner, Predicate<? super T> predicate)default Scanner<T>Scanner. append(Scanner<T> scanner)Concats the provided Scanner after the current Scanner.MScannerToGroups. apply(Scanner<T> scanner)MScannerToMap. apply(Scanner<T> scanner)static <T, C extends Collection<T>>
CScannerTool. collect(Scanner<T> scanner, Supplier<C> collectionSupplier)intComparableScanner. compareTo(Scanner<T> that)static <T> Scanner<T>Scanner. concat(Scanner<T>... scanners)Combine the items from multiple Scanners into a single Scanner.static <T> longScannerTool. count(Scanner<T> scanner)static <T> Optional<T>ScannerTool. findAny(Scanner<T> scanner)static <T> Optional<T>ScannerTool. findFirst(Scanner<T> scanner)static <T> Optional<T>ScannerTool. findLast(Scanner<T> scanner)static <T> Scanner<T>ScannerTool. flush(Scanner<T> scanner, Consumer<List<T>> consumer)static <T> voidScannerTool. forEach(Scanner<T> scanner, Consumer<? super T> action)static <T> booleanScannerTool. hasAny(Scanner<T> scanner)static <T> booleanScannerTool. isEmpty(Scanner<T> scanner)static <T> ArrayList<T>ScannerTool. list(Scanner<T> scanner)static <T> Optional<T>ScannerTool. max(Scanner<T> scanner, Comparator<? super T> comparator)static <T> Optional<T>ScannerTool. min(Scanner<T> scanner, Comparator<? super T> comparator)static <T> Stream<T>ScannerTool. nativeStream(Scanner<T> scanner)static <T> booleanScannerTool. noneMatch(Scanner<T> scanner, Predicate<? super T> predicate)static <T> Optional<T>ScannerTool. reduce(Scanner<T> scanner, BinaryOperator<T> reducer)static <T> TScannerTool. reduce(Scanner<T> scanner, T seed, BinaryOperator<T> reducer)static <T> Scanner<T>ScannerTool. skip(Scanner<T> scanner, long numToSkip)static <T> Spliterator<T>ScannerTool. spliterator(Scanner<T> scanner)static <T> List<T>ScannerTool. take(Scanner<T> scanner, int numToTake)static Object[]ScannerTool. toArray(Scanner<?> scanner)Method parameters in io.datarouter.scanner with type arguments of type Scanner Modifier and Type Method Description default <R> RScanner. apply(Function<Scanner<T>,R> function)Beta: Apply the provided Function which returns another Scanner.default <R> Scanner<R>Scanner. collate(Function<? super T,Scanner<R>> mapper)Similar to the merge phase of a merge sort, assuming the input Scanners are sorted.default <R> Scanner<R>Scanner. collate(Function<? super T,Scanner<R>> mapper, Comparator<? super R> comparator)Similar to the merge phase of a merge sort, assuming the input Scanners are sorted.default <R> Scanner<R>Scanner. concat(Function<? super T,Scanner<R>> mapToScanner)Combine the items from multiple Scanners into a single Scanner.default <R> Scanner<R>Scanner. link(Function<Scanner<T>,BaseLinkedScanner<T,R>> scannerBuilder)A caller can extend BaseLinkedScanner, which has exception handling logic, and fluently include it in the Scanner pipeline.default voidScanner. then(Consumer<Scanner<T>> consumer)Beta: Pass the current Scanner to a method that will Consume this Scanner and return nothing.Constructor parameters in io.datarouter.scanner with type arguments of type Scanner Constructor Description CollatingScanner(List<Scanner<T>> inputs, Comparator<? super T> comparator)ConcatenatingScanner(Scanner<Scanner<T>> input)