Uses of Interface
io.datarouter.scanner.Scanner
-
Uses of Scanner in io.datarouter.scanner
Classes in io.datarouter.scanner that implement ScannerModifier and TypeClassDescriptionclassclassclassArrayScanner<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" methodclassclassclassclassclassclassDistinctScanner<T,R> classEachScanner<T>classEmptyScanner<T>classclassclassclassclassclassMappingScanner<T,R> classclassclassPagingScanner<K,T> Base class for things that page through results by passing the last item as an exclusive start key for the next pageclassclassclassAvoid an intermediate Iterator when scanning a List with RandomAccess layout.classclassAvoid an intermediate Iterator when scanning a List with RandomAccess layout.classclassclassclassSplittingScanner<T,R> classFields in io.datarouter.scanner declared as ScannerMethods in io.datarouter.scanner that return ScannerModifier and TypeMethodDescriptionScanner.advanceUntil(Predicate<? super T> predicate) Stop the scanner when the predicate matches, excluding the item that caused it to stop.Scanner.advanceWhile(Predicate<? super T> predicate) Stop the scanner when the predicated fails to match, excluding the item that caused it to stop.Concats the provided Scanner after the current Scanner.Concats the provided Iterable items after the current Scanner.Concats the provided array items after the current Scanner.Scanner.batch(int batchSize) default <R> Scanner<R>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.<R> Scanner<R>static <T> Scanner<T>Combine the items from multiple Scanners into a single Scanner.static <T> Scanner<T>Combine the items from multiple Iterables into a single Scanner.default <R> Scanner<R>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.Scanner.deduplicateConsecutive()Skips consecutive duplicates.Scanner.deduplicateConsecutiveBy(Function<T, ?> mapper) Skips items where the mapper outputs the same value as the previous item as compared with Objects::equals.Scanner.deduplicateConsecutiveBy(Function<T, R> mapper, BiPredicate<R, R> equalsPredicate) Skips items where the mapper outputs the same value as the previous item when compared with the supplied equalsPredicate.Scanner.distinct()Scanner.distinctBy(Function<T, ?> mapper) Calls Consumer::accept on each item.static <T> Scanner<T>Scanner.empty()Skips items where the Predicate returns true.static <T> Scanner<T>static <T> Scanner<T>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.Scanner.limit(long limit) Ends the Scanner when the limit has been reached.default <R> Scanner<R>A caller can extend BaseLinkedScanner, which has exception handling logic, and fluently include it in the Scanner pipeline.<R> Scanner<R>default <R> Scanner<R>For each input item, outputs the result of Function::apply.Scanner.maxN(Comparator<? super T> comparator, int num) Retains the max N items as defined by the comparator and returns a Scanner of them in descending order.static <T> Scanner<T>ScannerTool.maxNDesc(Scanner<T> scanner, Comparator<? super T> comparator, int num) Scanner.minN(Comparator<? super T> comparator, int num) Retains the min N items as defined by the comparator and returns a Scanner of them in ascending order.static <T> Scanner<T>ScannerTool.minNAsc(Scanner<T> scanner, Comparator<? super T> comparator, int num) static <T> Scanner<T>ArrayScanner.of(T[] array) static <T> Scanner<T>static <T> Scanner<T>static <T> Scanner<T>ObjectScanner.of(T object) static <T> Scanner<T>static <T> Scanner<T>static <T> Scanner<T>static <T> Scanner<T>Create a Scanner of items in the Iterable.static <T> Scanner<T>Create a Scanner of items in the Iterator.static <T> Scanner<T>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>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.Scanner.prefetch(ExecutorService exec, int batchSize) default Scanner<RetainingGroup<T>>Scanner.retain(int retaining) For retaining a window of N previous items.Scanner.reverse()Collect all items into an List and return a Scanner that iterates through them backwards.Scanner.sample(long sampleSize, boolean includeLast) Return every Nth item.Scanner.shuffle()static <T> Scanner<T>EmptyScanner.singleton()Scanner.skip(long numToSkip) Skip the leading items from the Scanner.static <T> Scanner<T>Scanner.sort()Scanner.sort(Comparator<? super T> comparator) 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 ScannerModifier and TypeMethodDescriptionstatic <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) ScannerToMap.of()ScannerToMap.of(Function<T, K> keyFunction, Function<T, V> valueFunction, ScannerToMap.Replace replacePolicy) ScannerToMap.of(Function<T, K> keyFunction, Function<T, V> valueFunction, BinaryOperator<V> mergeFunction) ScannerToMap.ofSupplied(Function<T, K> keyFunction, Function<T, V> valueFunction, ScannerToMap.Replace replacePolicy, Supplier<M> mapSupplier) ScannerToMap.ofSupplied(Function<T, K> keyFunction, Function<T, V> valueFunction, BinaryOperator<V> mergeFunction, Supplier<M> mapSupplier) ScannerToMap.ofSupplied(Function<T, K> keyFunction, Function<T, V> valueFunction, Supplier<M> mapSupplier) ScannerToMap.ofSupplied(Function<T, K> keyFunction, Supplier<M> mapSupplier) 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 ScannerModifier and TypeMethodDescriptionstatic <T> booleanstatic <T> booleanConcats the provided Scanner after the current Scanner.static <T,C extends Collection<T>>
Cintstatic <T> Scanner<T>Combine the items from multiple Scanners into a single Scanner.static <T> longstatic <T> Optional<T>static <T> Optional<T>static <T> Scanner<T>static <T> voidstatic <T> booleanstatic <T> booleanstatic <T> ArrayList<T>static <T> Optional<T>ScannerTool.max(Scanner<T> scanner, Comparator<? super T> comparator) static <T> Scanner<T>ScannerTool.maxNDesc(Scanner<T> scanner, Comparator<? super T> comparator, int num) static <T> Optional<T>ScannerTool.min(Scanner<T> scanner, Comparator<? super T> comparator) static <T> Scanner<T>ScannerTool.minNAsc(Scanner<T> scanner, Comparator<? super T> comparator, int num) static <T> Stream<T>ScannerTool.nativeStream(Scanner<T> scanner) static <T> booleanstatic <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>static <T> Spliterator<T>ScannerTool.spliterator(Scanner<T> scanner) static <T> List<T>static Object[]Method parameters in io.datarouter.scanner with type arguments of type ScannerModifier and TypeMethodDescriptiondefault <R> RBeta: Apply the provided Function which returns another Scanner.default <R> Scanner<R>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.<R> Scanner<R>default <R> Scanner<R>Combine the items from multiple Scanners into a single Scanner.default <R> Scanner<R>A caller can extend BaseLinkedScanner, which has exception handling logic, and fluently include it in the Scanner pipeline.default voidBeta: Pass the current Scanner to a method that will Consume this Scanner and return nothing.Constructors in io.datarouter.scanner with parameters of type ScannerModifierConstructorDescriptionAdvanceUntilScanner(Scanner<T> input, Predicate<? super T> predicate) AdvanceWhileScanner(Scanner<T> input, Predicate<? super T> predicate) BaseLinkedScanner(Scanner<T> input) BatchingScanner(Scanner<T> input, int batchSize) ComparableScanner(Scanner<T> input, Comparator<? super T> comparator) ConcatenatingScanner(Scanner<Scanner<T>> input) DeduplicatingConsecutiveScanner(Scanner<T> input, Function<T, R> mapper, BiPredicate<R, R> equalsPredicate) EachScanner(Scanner<T> input, Consumer<? super T> consumer) FilteringScanner(Scanner<T> input, Predicate<? super T> predicate) LimitingScanner(Scanner<T> input, long limit) NaturalSortingScanner(Scanner<T> input) ParallelMappingScanner(Scanner<T> input, boolean allowUnorderedResults, ExecutorService executor, int numThreads, Function<? super T, ? extends R> mapper) ParallelScanner(ParallelScannerContext context, Scanner<T> input) PrefetchingScanner(Scanner<T> input, ExecutorService exec, int batchSize) RetainingScanner(Scanner<T> input, int retaining) SamplingScanner(Scanner<T> input, long sampleSize, boolean includeLast) ScannerIterator(Scanner<T> scanner) ScannerStream(Scanner<T> scanner) ShufflingScanner(Scanner<T> input) SortingScanner(Scanner<T> input, Comparator<? super T> comparator) Constructor parameters in io.datarouter.scanner with type arguments of type ScannerModifierConstructorDescriptionCollatingScanner(List<Scanner<T>> inputs, Comparator<? super T> comparator) ConcatenatingScanner(Scanner<Scanner<T>> input)