public static final class ReductionUtil.LongSupplierReduction<A> extends Object implements Reduction<LongSupplier>
Reduction.DoubleReductionBuilder, Reduction.LongReductionBuilder, Reduction.ReductionBuilder<E>| Constructor and Description |
|---|
LongSupplierReduction(@NotNull ToLongDocumentExtractor extractor,
@NotNull Supplier<A> supplier,
@NotNull ObjLongConsumer<A> accumulator,
@NotNull ToLongFunction<A> finisher) |
| Modifier and Type | Method and Description |
|---|---|
long |
accept(@NotNull MarshallableIn tailer)
Accepts the input of the provided
tailer and reduces (folds) the contents of it
into this Reduction returning the last seen index or -1 if no index was seen. |
void |
onExcerpt(@NotNull Wire wire,
long index)
Consumes an excerpt from the provided
wire at the index at the provided index. |
@NotNull LongSupplier |
reduction()
Returns a view of the underlying reduction.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitof, ofDouble, ofLongandThenpublic LongSupplierReduction(@NotNull
@NotNull ToLongDocumentExtractor extractor,
@NotNull
@NotNull Supplier<A> supplier,
@NotNull
@NotNull ObjLongConsumer<A> accumulator,
@NotNull
@NotNull ToLongFunction<A> finisher)
public void onExcerpt(@NotNull
@NotNull Wire wire,
long index)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
Reductionwire at the index at the provided index.
If this method throws an Exception, it is relayed to the call site. Therefore, care should be taken to minimise the probability of throwing Exceptions.
If this method is referenced as an ExcerptListener then the Reduction must be
thread-safe.
onExcerpt in interface Reduction<LongSupplier>onExcerpt in interface ExcerptListenerwire - representing access to the excerpt that was stored (non-null).index - in the queue where the except was placed (non-negative)net.openhft.chronicle.core.io.InvalidMarshallableException@NotNull public @NotNull LongSupplier reduction()
Reductionreduction in interface Reduction<LongSupplier>public long accept(@NotNull
@NotNull MarshallableIn tailer)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
Reductiontailer and reduces (folds) the contents of it
into this Reduction returning the last seen index or -1 if no index was seen.
This method can be used to initialise a Reduction before appending new values.
It is the responsibility of the caller to make sure no simultaneous appenders are using this Reduction during the entire fold operation.
accept in interface Reduction<LongSupplier>tailer - to reduce (fold) fromnet.openhft.chronicle.core.io.InvalidMarshallableExceptionCopyright © 2023. All rights reserved.