# Package com.saxonica.ee.stream.adjunct

This package contains classes used to support streaming. For every kind of expression that can appear in the expression tree, there is an auxiliary or adjunct class that contains the code needed to support streaming (if any).

None of these classes will be used directly by typical user applications.

The interface to these adjunct classes is defined in the abstract class `StreamingAdjunct`. The main methods are `getWatchMaker()` and `getFeedMaker()` which return a factory for respectively a `Watch` and a `Feed`; a Watch is used to evaluate the expression in decomposed push mode, an event at a time, while a Feed is used to evaluate it in composed push mode, an item at a time.

The association between an expression class and its corresponding adjunct is held in a static map maintained by the class `StreamingAdjunct`.

- Class Summary
  Class | Description
  --- | ---
  AbsorbingFunctionCallAdjunct | Handle streaming for calls to user-defined functions with streamability="absorbing"
  AccumulatorAfterStreamer | Generate streaming code for an accumulator-after() function call, particularly in the case where the instruction is consuming and therefore has to defer evaluation until the endElement event.
  AdjacentTextNodeMergerAdjunct | Streaming implementation of an AdjacentTextNodeMerger expression
  ApplyImportsAdjunct | Compile an xsl:apply-imports expression/instruction to Java source code.
  ApplyTemplatesAdjunct | Handle streaming for the xsl:apply-templates instruction
  ArrayBlockAdjunct | Generate streaming code for a Block, that is a sequence of expressions or instructions
  AscentFunctionCallAdjunct | Handle streaming for calls to user-defined functions with streamability="ascent"
  AtomicSequenceConverterAdjunct | Compile a AtomicSequenceConverter or UntypedSequenceConverter expression to streaming code.
  AtomizerAdjunct | Streaming adjunct class for an atomizer (or call on the data() function)
  AxisExpressionAdjunct | Compile an axis expression to streaming code.
  BlockAdjunct | Generate streaming code for a Block, that is a sequence of expressions or instructions
  BooleanFnFeed | Feed implementation supporting the `fn:boolean()` and `fn:not()` functions
  BooleanFnFeed.Negative | Feed implementation for the fn:not function
  BooleanFnFeed.Positive | Feed implementation for the fn:boolean function
  BooleanFnStreamer | Streaming code for an fn:boolean() function call
  CallTemplateAdjunct |
  CardinalityCheckerAdjunct | Generate streaming code for a cardinality checker
  ChooseAdjunct | Streaming code to implement a conditional ("if/choose") expression
  CodepointsToStringStreamer |
  ComposingAdjunct | Watch factory class for an class that composes items from sequences of events: examples are copy-of(), data(), and string().
  ConditionalBlockAdjunct | Generate streaming code for a conditional Block, that is a sequence constructor containing xsl:on-empty and/or xsl:on-not-empty instructions
  ConditionalBlockAdjunct.ConditionalBlockFeed |
  ContextItemExprAdjunct |
  CopyAdjunct | Compile an xsl:copy expression/instruction to streaming code.
  CopyOfAdjunct |
  CountStreamer | Streaming code for the count() function.
  CurrentGroupStreamer | Provides streaming code for a call on current-group().
  CurrentMergeGroupStreamer | Generate streaming code for a call on current-merge-group().
  DeepDescentFunctionCallAdjunct | Handle streaming for calls to user-defined functions with streamability="absorbing"
  DeepEqualStreamer | Implement streaming of deep-equal function.
  DistinctValuesStreamer | Implement the distinct-values function in streaming mode.
  DocumentInstrAdjunct | Evaluate an xsl:document instruction in streaming code.
  DocumentInstrAdjunct.DocumentInstrFeed |
  DocumentSorterAdjunct | Generate streaming code for a document sorting expression node.
  ElementCreatorAdjunct | Generate streaming code for an xsl:element instruction
  EmptyStreamer | Streaming code for an fn:empty() function call
  EmptyTextNodeRemoverAdjunct | Compile an EmptyTextNodeRemover expression to Java source code Needed only for streaming - this class is not used in XQuery
  ExistsStreamer | Streaming code for an fn:exists() function call
  FeedToEventBuffer | An ItemFeed that captures all written events in a buffer for subsequent replay.
  FilterExpressionAdjunct | Generate streaming code for a filter expression (when not part of a Watch).
  FilterFnStreamer | Generate streaming code for the fn:filter function.
  FilterFunctionCallAdjunct | Handle streaming for calls to user-defined functions with streamability="filter"
  FilteringAdjunct | A subclass of StreamingAdjunct used for expressions that have a sequence-valued operand with usage transmission.
  FirstItemExpressionAdjunct | Generate streaming code for a first item expression (when not part of a Watch).
  FoldStreamer | Streaming code for functions implemented as fold operations.
  ForEachAdjunct | Compile an xsl:for-each instruction to streaming code.
  ForEachGroupAdjunct | Compile an xsl:for-each-group instruction to streaming code.
  ForExpressionAdjunct | Streaming code to implement a "for" expression
  ForExpressionAdjunct.ForExpressionFeed |
  ForkAdjunct | Streaming code to implement an xsl:fork expression
  GeneralComparisonAdjunct | Watch factory class for a general comparison
  GroupAdjacentTester | This class implements GroupingFeed when the group-adjacent option is used.
  GroupBoundaryTester | This feed supports xsl:for-each-group in streaming mode.
  GroupEndingTester | This class implements GroupingFeed when the group-ending-with option is used.
  GroupStartingTester | This class implements GroupingFeed when the group-starting-with option is used.
  IndexOfStreamer | Generate streaming code for the index-of() function.
  InsertBeforeStreamer | Implement streaming of insert-before instruction.
  InspectionAdjunct | Abstract superclass for constructs that have operand usage "inspection" on their primary (sequence-valued) operand
  InstanceOfAdjunct | Generate streaming code for an "instance of" expression
  IsLastExprAdjunct |
  ItemCheckerAdjunct | Streaming code for an item checker
  ItemsAfterStreamer | Generate streaming code for the saxon:items-after function.
  ItemsBeforeStreamer | Generate streaming code for the saxon:items-before function.
  ItemsFromStreamer | Generate streaming code for the saxon:items-from function.
  ItemsUntilStreamer | Generate streaming code for the saxon:items-after function.
  IterateAdjunct | Implement streaming code for xsl:iterate
  LastStreamer |
  LetExpressionAdjunct | Compiles streaming code to implement a Let expression
  LetExpressionAdjunctB | Compiles streaming code to implement a Let expression for which the "action" part (the return clause) is consuming
  LiteralAdjunct | Streamed evaluation of a literal (not difficult!)
  MapEntryStreamer | Streaming code to implement an xsl:map instruction or map constructor, where each map entry is allowed to be consuming.
  MergeInstrAdjunct | Streaming adjunct for the xsl:merge instruction.
  MinimaxStreamer | Generate streaming code for the min() and max() functions.
  NewMapStreamer | Streaming code to implement an xsl:map instruction or map constructor, where each map entry is allowed to be consuming.
  NextIterationAdjunct | Compile a xsl:next-intruction instruction to streaming code.
  NextMatchAdjunct | Compile an xsl:next-match expression/instruction to streaming code.
  NotFnStreamer | Streaming code for an fn:not() function call
  OnEmptyAdjunct | Generate streaming code for a consuming xsl:on-empty instruction
  OnNonEmptyAdjunct | Generate streaming code for a consuming xsl:on-non-empty instruction
  OutermostStreamer | Streaming code for an outermost() function call.
  ParentConstructorAdjunct | Watch factory class for an atomizer
  RemoveStreamer | Generate streaming code for a remove() function call.
  ResultDocumentAdjunct | Handle an xsl:result-document expression/instruction for XSLT streaming capability.
  ResultDocumentAdjunct.ResultDocumentFeed |
  ReverseStreamer |
  RootExpressionAdjunct | Streaming code for an expression that does not support streaming
  RootStreamer |
  SequenceInstrAdjunct |
  ShallowDescentFunctionCallAdjunct | Handle streaming for calls to user-defined functions with streamability="shallow-descent"
  SimpleNodeConstructorAdjunct | Generate streaming code for an xsl:value-of, xsl:comment, xsl:processing-instruction instruction, etc
  SingletonAtomizerAdjunct | Watch factory class for a singleton atomizer
  SnapshotFnStreamer | Generate streaming code for the snapshot() function
  SortExpressionAdjunct | Streaming code for sort expression.
  StreamingAdjunct | This abstract class supplements an `Expression` with methods used at compile-time to support streaming, by generating a `Watch` that allows the expression to be evaluated in push mode.
  StringFnStreamer | Streaming code to implement the XPath string() function
  SubscriptExpressionAdjunct | Streaming code for a subscript expression
  SubsequenceStreamer | Generate streaming code for a subsequence() function call.
  SubsequenceStreamer.SubsequenceFilter |
  SwitchAdjunct | Streaming code to implement a switch expression, which results from optimizing a choose where all the branches have similar test conditions.
  TailExpressionAdjunct |
  TraceExprAdjunct | Implement streaming of the trace instruction injected into the code when compiled with tracing enabled.
  TraceStreamer | Implement streaming of fn:trace instruction.
  TransmissionAdjunct | A subclass of StreamingAdjunct used for expressions that have a sequence-valued operand with usage transmission.
  TreatFnStreamer | Generate streaming code for a "treat" function call (for example one-or-more)
  TryCatchAdjunct | Streaming code for a try/catch expression
  TryCatchAdjunct.TryCatchFeed |
  UseAttributeSetAdjunct |
  UserFunctionCallAdjunct | Handle streaming for calls to user-defined functions Used only for XSLT streaming capability.
  VariableReferenceAdjunct |
  VennExpressionAdjunct |
  WherePopulatedAdjunct | Generate streaming code for an xsl:where-populated instruction.
  XmlToJsonFnStreamer | Streaming code for the xml-to-json() function