## com.saxonica.stream.feed
Class ItemFeed

    java.lang.Object
      com.saxonica.stream.feed.ItemFeed

All Implemented Interfaces:
  Feed

Direct Known Subclasses:
  AdjacentTextNodeMergerFeed, AtomizerFeed, AvgFeed, BlockFeed, BufferingFeed, CardinalityCheckingFeed, CountFeed, DistinctValuesFeed, EmptyTextNodeRemoverFeed, FilterExpressionFeed, ForEachFeed, GeneralComparisonFeed, ItemMappingFeed, MinimaxFeed, NextIterationFeed, SimpleNodeConstructorFeed, StringJoinFeed, SumFeed, WithParamFeed

    public abstract class ItemFeed

extends Object
implements Feed

An ItemFeed evaluates an expression in "composed push" mode. Its streaming input is supplied via a sequence of append() calls that supply individual (composed) items in the input sequence, and its output is (in most cases) delivered via a sequence of append() calls to the feed representing the parent expression. The exception is the FeedToReceiver class which appends the supplied items to a Receiver. Every kind of expression can be evaluated using an ItemFeed. The ItemFeed is obtained by calling getFeedMaker() on the ExpressionCompiler corresponding to the class of expression. The expression must have been previously marked to indicate which of its inputs is being supplied in streaming mode.

Constructor Summary
`ItemFeed(Expression exp, Feed result, Stack<XPathContext> contextStack)`

Method Summary
`abstract void` `append(Item item)` Supply one item towards the streamed input of the expression
`void` `close()` Finish evaluating the expression.
`XPathContext` `getContext()` Get the dynamic evaluation context
`Stack<XPathContext>` `getContextStack()`
`Expression` `getExpression()` Get the expression being evaluated by this ItemFeed
`PipelineConfiguration` `getPipelineConfiguration()` Get the pipeline configuration
`Feed` `getResult()` Get the result, that is, the ItemFeed to which the items in the result of the expression should be supplied
`void` `open()` Start evaluating the expression.
`void` `setPipelineConfiguration(PipelineConfiguration pipe)` Set the pipeline configuration

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ItemFeed

    public ItemFeed(Expression exp,
                    Feed result,
                    Stack<XPathContext> contextStack)

Method Detail

### getExpression

    public Expression getExpression()

  Get the expression being evaluated by this ItemFeed

  Returns:
    the expression being evaluated

### getResult

    public Feed getResult()

  Get the result, that is, the ItemFeed to which the items in the result of the expression should be supplied

  Returns:
    the ItemFeed that consumes the results of this expression

### setPipelineConfiguration

    public void setPipelineConfiguration(PipelineConfiguration pipe)

  Set the pipeline configuration

  Parameters:
    `pipe` - the pipeline configuration

### getPipelineConfiguration

    public PipelineConfiguration getPipelineConfiguration()

  Get the pipeline configuration

  Specified by:
    `getPipelineConfiguration` in interface `Feed`
  Returns:
    the pipeline configuration

### getContext

    public XPathContext getContext()

  Get the dynamic evaluation context

  Returns:
    the dynamic evaluation context

### getContextStack

    public Stack<XPathContext> getContextStack()

### open

    public void open()
              throws XPathException

  Start evaluating the expression. The default implementation does nothing.

  Specified by:
    `open` in interface `Feed`
  Throws:
    `XPathException` - if a dynamic error occurs

### append

    public abstract void append(Item item)
                         throws XPathException

  Supply one item towards the streamed input of the expression

  Specified by:
    `append` in interface `Feed`
  Parameters:
    `item` - the item to be supplied
  Throws:
    `XPathException` - to report any failure

### close

    public void close()
               throws XPathException

  Finish evaluating the expression. The default implementation does nothing.

  Specified by:
    `close` in interface `Feed`
  Throws:
    `XPathException` - if a dynamic error occurs

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.