| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | package net.sf.saxon.expr.accum; |
| 9 | |
| 10 | import net.sf.saxon.om.Item; |
| 11 | import net.sf.saxon.om.NodeInfo; |
| 12 | import net.sf.saxon.om.Sequence; |
| 13 | import net.sf.saxon.trans.XPathException; |
| 14 | |
| 15 | /** |
| 16 | * Holds the values of an accumulator function for one non-streamed document |
| 17 | */ |
| 18 | public interface IAccumulatorData { |
| 19 | |
| 20 | /** |
| 21 | * Get the associated accumulator |
| 22 | * |
| 23 | * @return the accumulator |
| 24 | */ |
| 25 | |
| 26 | Accumulator getAccumulator(); |
| 27 | |
| 28 | /** |
| 29 | * Get the value of the accumulator for a given node |
| 30 | * |
| 31 | * @param node the node in question |
| 32 | * @param postDescent false if the pre-descent value of the accumulator is required; |
| 33 | * false if the post-descent value is wanted. |
| 34 | * @return the value of the accumulator for this node |
| 35 | */ |
| 36 | |
| 37 | Sequence<?> getValue(NodeInfo node, boolean postDescent) throws XPathException; |
| 38 | |
| 39 | |
| 40 | } |