find

package
v1.2.56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FindOp

type FindOp struct {
	terminal.TODOOperation
	// contains filtered or unexported fields
}

*

  • A short-circuiting {@code TerminalOp} that searches for an element in a
  • stream pipeline, and terminates when it finds one. Implements both
  • find-first (find the first element in the encounter order) and find-any
  • (find any element, may not be the first in encounter order.) *
  • @param <T> the output type of the stream pipeline
  • @param <O> the result type of the find operation, typically an optional
  • type

func NewFindOp

func NewFindOp(mustFindFirst bool, presentPredicate predicate.Predicater, sinkSupplier func() *FindSink) *FindOp

*

  • Constructs a {@code Operation}. *
  • @param mustFindFirst if true, must find the first element in
  • encounter order, otherwise can find any element
  • @param shape stream shape of elements to search
  • @param emptyValue result value corresponding to "found nothing"
  • @param presentPredicate {@code Predicate} on result value
  • corresponding to "found something"
  • @param sinkSupplier supplier for a {@code TerminalSink} implementing
  • the matching functionality

func NewFindOp2

func NewFindOp2(mustFindFirst bool, presentPredicate predicate.Predicater) *FindOp

func (FindOp) EvaluateParallel

func (op FindOp) EvaluateParallel(ctx context.Context, spliterator spliterator.Spliterator) optional.Optional

func (FindOp) EvaluateSequential

func (op FindOp) EvaluateSequential(ctx context.Context, spliterator spliterator.Spliterator) optional.Optional

func (FindOp) MakeSink

func (op FindOp) MakeSink() *FindSink

type FindSink

type FindSink struct {
	terminal.TODOSink
	// contains filtered or unexported fields
}

func NewFindSink

func NewFindSink() *FindSink

func (*FindSink) Accept

func (sink *FindSink) Accept(value interface{})

stores only first value

func (*FindSink) CancellationRequested

func (sink *FindSink) CancellationRequested() bool

return true if found

func (*FindSink) Get

func (sink *FindSink) Get() optional.Optional

type FindTask

type FindTask struct {
	terminal.TODOShortCircuitTask
	// contains filtered or unexported fields
}

func (*FindTask) DoLeaf

func (task *FindTask) DoLeaf(ctx context.Context) terminal.Sink

func (*FindTask) MakeChild

func (task *FindTask) MakeChild(spliterator spliterator.Spliterator) terminal.Task

func (*FindTask) OnCompletion

func (task *FindTask) OnCompletion(caller terminal.Task)

func (*FindTask) WithParent

func (task *FindTask) WithParent(parent *FindTask, spliterator spliterator.Spliterator) *FindTask

*

  • Constructor for non-root nodes. *
  • @param parent parent task in the computation tree
  • @param spliterator the {@code Spliterator} for the portion of the
  • computation tree described by this task

func (*FindTask) WithSpliterator

func (task *FindTask) WithSpliterator(op FindOp, spliterator spliterator.Spliterator) *FindTask

*

  • Constructor for root tasks. *
  • @param helper the {@code PipelineHelper} describing the stream pipeline
  • up to this operation
  • @param spliterator the {@code Spliterator} describing the source for this
  • pipeline

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL