<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 09 20:48:43 GMT 2011 --> <TITLE> Closure </TITLE> <META NAME="date" CONTENT="2011-12-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Closure"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../net/sf/saxon/value/Cardinality.html" title="class in net.sf.saxon.value"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/value/DateTimeValue.html" title="class in net.sf.saxon.value"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/value/Closure.html" target="_top"><B>FRAMES</B></A> <A HREF="Closure.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> net.sf.saxon.value</FONT> <BR> Class Closure<T extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></H2> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">net.sf.saxon.value.Value</A><T> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.saxon.value.Closure<T></B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../net/sf/saxon/om/ValueRepresentation.html" title="interface in net.sf.saxon.om">ValueRepresentation</A><T></DD> </DL> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../net/sf/saxon/value/MemoClosure.html" title="class in net.sf.saxon.value">MemoClosure</A>, <A HREF="../../../../net/sf/saxon/value/SingletonClosure.html" title="class in net.sf.saxon.value">SingletonClosure</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>Closure<T extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></B><DT>extends <A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><T></DL> </PRE> <P> A Closure represents a value that has not yet been evaluated: the value is represented by an expression, together with saved values of all the context variables that the expression depends on. <p>This Closure is designed for use when the value is only read once. If the value is read more than once, a new iterator over the underlying expression is obtained each time: this may (for example in the case of a filter expression) involve significant re-calculation.</p> <p>The expression may depend on local variables and on the context item; these values are held in the saved XPathContext object that is kept as part of the Closure, and they will always be read from that object. The expression may also depend on global variables; these are unchanging, so they can be read from the Bindery in the normal way. Expressions that depend on other contextual information, for example the values of position(), last(), current(), current-group(), should not be evaluated using this mechanism: they should always be evaluated eagerly. This means that the Closure does not need to keep a copy of these context variables.</p> <P> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#depth">depth</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#expression">expression</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#inputIterator">inputIterator</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../../net/sf/saxon/expr/XPathContextMajor.html" title="class in net.sf.saxon.expr">XPathContextMajor</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#savedXPathContext">savedXPathContext</A></B></CODE> <BR> </TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_net.sf.saxon.value.Value"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from class net.sf.saxon.value.<A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#INDETERMINATE_ORDERING">INDETERMINATE_ORDERING</A></CODE></TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_net.sf.saxon.om.ValueRepresentation"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Fields inherited from interface net.sf.saxon.om.<A HREF="../../../../net/sf/saxon/om/ValueRepresentation.html" title="interface in net.sf.saxon.om">ValueRepresentation</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../net/sf/saxon/om/ValueRepresentation.html#EMPTY_VALUE_ARRAY">EMPTY_VALUE_ARRAY</A></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#Closure()">Closure</A></B>()</CODE> <BR> Constructor should not be called directly, instances should be made using the make() method.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#getCardinality()">getCardinality</A></B>()</CODE> <BR> Get the cardinality</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#getExpression()">getExpression</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/type/ItemType.html" title="interface in net.sf.saxon.type">ItemType</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#getItemType(net.sf.saxon.type.TypeHierarchy)">getItemType</A></B>(<A HREF="../../../../net/sf/saxon/type/TypeHierarchy.html" title="class in net.sf.saxon.type">TypeHierarchy</A> th)</CODE> <BR> Get the static item type</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/expr/XPathContextMajor.html" title="class in net.sf.saxon.expr">XPathContextMajor</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#getSavedXPathContext()">getSavedXPathContext</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#iterate()">iterate</A></B>()</CODE> <BR> Evaluate the expression in a given context to return an iterator over a sequence</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#make(net.sf.saxon.expr.Expression, net.sf.saxon.expr.XPathContext, int)">make</A></B>(<A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> expression, <A HREF="../../../../net/sf/saxon/expr/XPathContext.html" title="interface in net.sf.saxon.expr">XPathContext</A> context, int ref)</CODE> <BR> Construct a Closure by supplying the expression and the set of context variables.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> <TR ALIGN="right" VALIGN=""> <TD NOWRAP><FONT SIZE="-1"> <CODE><T extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>> <BR> <A HREF="../../../../net/sf/saxon/om/ValueRepresentation.html" title="interface in net.sf.saxon.om">ValueRepresentation</A><T></CODE></FONT></TD> </TR> </TABLE> </CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#makeIteratorClosure(net.sf.saxon.om.SequenceIterator)">makeIteratorClosure</A></B>(<A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><T> iterator)</CODE> <BR> Construct a Closure over an existing SequenceIterator.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#process(net.sf.saxon.expr.XPathContext)">process</A></B>(<A HREF="../../../../net/sf/saxon/expr/XPathContext.html" title="interface in net.sf.saxon.expr">XPathContext</A> context)</CODE> <BR> Process the instruction, without returning any tail calls</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#reduce()">reduce</A></B>()</CODE> <BR> Reduce a value to its simplest form.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#saveContext(net.sf.saxon.expr.Expression, net.sf.saxon.expr.XPathContext)">saveContext</A></B>(<A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> expression, <A HREF="../../../../net/sf/saxon/expr/XPathContext.html" title="interface in net.sf.saxon.expr">XPathContext</A> context)</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#setExpression(net.sf.saxon.expr.Expression)">setExpression</A></B>(<A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> expression)</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/saxon/value/Closure.html#setSavedXPathContext(net.sf.saxon.expr.XPathContextMajor)">setSavedXPathContext</A></B>(<A HREF="../../../../net/sf/saxon/expr/XPathContextMajor.html" title="class in net.sf.saxon.expr">XPathContextMajor</A> savedXPathContext)</CODE> <BR> </TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_net.sf.saxon.value.Value"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class net.sf.saxon.value.<A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#asItem()">asItem</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#asItem(net.sf.saxon.om.ValueRepresentation)">asItem</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#asIterator(net.sf.saxon.om.ValueRepresentation)">asIterator</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#asValue(net.sf.saxon.om.ValueRepresentation)">asValue</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#checkPermittedContents(net.sf.saxon.type.SchemaType, net.sf.saxon.expr.StaticContext, boolean)">checkPermittedContents</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#convertToJava(net.sf.saxon.om.Item)">convertToJava</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#effectiveBooleanValue()">effectiveBooleanValue</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#fromItem(net.sf.saxon.om.Item)">fromItem</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getCanonicalLexicalRepresentation()">getCanonicalLexicalRepresentation</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getIterator(net.sf.saxon.om.ValueRepresentation)">getIterator</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getLength()">getLength</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getSchemaComparable()">getSchemaComparable</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getSequenceLength(net.sf.saxon.om.ValueRepresentation)">getSequenceLength</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getStringValue()">getStringValue</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#getStringValueCS()">getStringValueCS</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#hashCode()">hashCode</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#isIdentical(net.sf.saxon.value.Value)">isIdentical</A>, <A HREF="../../../../net/sf/saxon/value/Value.html#itemAt(int)">itemAt</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="expression"><!-- --></A><H3> expression</H3> <PRE> protected <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> <B>expression</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="savedXPathContext"><!-- --></A><H3> savedXPathContext</H3> <PRE> protected <A HREF="../../../../net/sf/saxon/expr/XPathContextMajor.html" title="class in net.sf.saxon.expr">XPathContextMajor</A> <B>savedXPathContext</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="depth"><!-- --></A><H3> depth</H3> <PRE> protected int <B>depth</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="inputIterator"><!-- --></A><H3> inputIterator</H3> <PRE> protected <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A> extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>> <B>inputIterator</B></PRE> <DL> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="Closure()"><!-- --></A><H3> Closure</H3> <PRE> public <B>Closure</B>()</PRE> <DL> <DD>Constructor should not be called directly, instances should be made using the make() method. <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="makeIteratorClosure(net.sf.saxon.om.SequenceIterator)"><!-- --></A><H3> makeIteratorClosure</H3> <PRE> public static <T extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>> <A HREF="../../../../net/sf/saxon/om/ValueRepresentation.html" title="interface in net.sf.saxon.om">ValueRepresentation</A><T> <B>makeIteratorClosure</B>(<A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><T> iterator) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Construct a Closure over an existing SequenceIterator. This is used when an extension function returns a SequenceIterator as its result (it replaces the old SequenceIntent class for this purpose). There is no known expression in this case. Note that the caller must ensure this is a "clean" iterator: it must be positioned at the start, and must not be shared by anyone else. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>iterator</CODE> - the supplied iterator <DT><B>Returns:</B><DD>the Closure over this iterator <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs</DL> </DD> </DL> <HR> <A NAME="make(net.sf.saxon.expr.Expression, net.sf.saxon.expr.XPathContext, int)"><!-- --></A><H3> make</H3> <PRE> public static <A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A> <B>make</B>(<A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> expression, <A HREF="../../../../net/sf/saxon/expr/XPathContext.html" title="interface in net.sf.saxon.expr">XPathContext</A> context, int ref) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Construct a Closure by supplying the expression and the set of context variables. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>expression</CODE> - the expression to be lazily evaluated<DD><CODE>context</CODE> - the dynamic context of the expression including for example the variables on which it depends<DD><CODE>ref</CODE> - the number of references to the value being lazily evaluated; this affects the kind of Closure that is created <DT><B>Returns:</B><DD>the Closure, a virtual value that can later be materialized when its content is required <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs</DL> </DD> </DL> <HR> <A NAME="saveContext(net.sf.saxon.expr.Expression, net.sf.saxon.expr.XPathContext)"><!-- --></A><H3> saveContext</H3> <PRE> public void <B>saveContext</B>(<A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> expression, <A HREF="../../../../net/sf/saxon/expr/XPathContext.html" title="interface in net.sf.saxon.expr">XPathContext</A> context) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="getItemType(net.sf.saxon.type.TypeHierarchy)"><!-- --></A><H3> getItemType</H3> <PRE> public <A HREF="../../../../net/sf/saxon/type/ItemType.html" title="interface in net.sf.saxon.type">ItemType</A> <B>getItemType</B>(<A HREF="../../../../net/sf/saxon/type/TypeHierarchy.html" title="class in net.sf.saxon.type">TypeHierarchy</A> th)</PRE> <DL> <DD>Get the static item type <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#getItemType(net.sf.saxon.type.TypeHierarchy)">getItemType</A></CODE> in class <CODE><A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A> extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>th</CODE> - the type hierarchy cache <DT><B>Returns:</B><DD>for the default implementation: AnyItemType (not known)</DL> </DD> </DL> <HR> <A NAME="getCardinality()"><!-- --></A><H3> getCardinality</H3> <PRE> public int <B>getCardinality</B>()</PRE> <DL> <DD>Get the cardinality <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#getCardinality()">getCardinality</A></CODE> in class <CODE><A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A> extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the cardinality</DL> </DD> </DL> <HR> <A NAME="getExpression()"><!-- --></A><H3> getExpression</H3> <PRE> public <A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> <B>getExpression</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getSavedXPathContext()"><!-- --></A><H3> getSavedXPathContext</H3> <PRE> public <A HREF="../../../../net/sf/saxon/expr/XPathContextMajor.html" title="class in net.sf.saxon.expr">XPathContextMajor</A> <B>getSavedXPathContext</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setExpression(net.sf.saxon.expr.Expression)"><!-- --></A><H3> setExpression</H3> <PRE> public void <B>setExpression</B>(<A HREF="../../../../net/sf/saxon/expr/Expression.html" title="class in net.sf.saxon.expr">Expression</A> expression)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setSavedXPathContext(net.sf.saxon.expr.XPathContextMajor)"><!-- --></A><H3> setSavedXPathContext</H3> <PRE> public void <B>setSavedXPathContext</B>(<A HREF="../../../../net/sf/saxon/expr/XPathContextMajor.html" title="class in net.sf.saxon.expr">XPathContextMajor</A> savedXPathContext)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="iterate()"><!-- --></A><H3> iterate</H3> <PRE> public <A HREF="../../../../net/sf/saxon/om/SequenceIterator.html" title="interface in net.sf.saxon.om">SequenceIterator</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A>> <B>iterate</B>() throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Evaluate the expression in a given context to return an iterator over a sequence <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#iterate()">iterate</A></CODE> in class <CODE><A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A> extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an iterator over the sequence of items <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if a dynamic error occurs. This is possible only in the case of values that are materialized lazily, that is, where the iterate() method leads to computation of an expression that delivers the values.</DL> </DD> </DL> <HR> <A NAME="process(net.sf.saxon.expr.XPathContext)"><!-- --></A><H3> process</H3> <PRE> public void <B>process</B>(<A HREF="../../../../net/sf/saxon/expr/XPathContext.html" title="interface in net.sf.saxon.expr">XPathContext</A> context) throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Process the instruction, without returning any tail calls <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#process(net.sf.saxon.expr.XPathContext)">process</A></CODE> in class <CODE><A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A> extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>context</CODE> - The dynamic context, giving access to the current node, the current variables, etc. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if an error occurs (for example if the value is a closure that needs to be evaluated)</DL> </DD> </DL> <HR> <A NAME="reduce()"><!-- --></A><H3> reduce</H3> <PRE> public <A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A>> <B>reduce</B>() throws <A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></PRE> <DL> <DD>Reduce a value to its simplest form. If the value is a closure or some other form of deferred value such as a FunctionCallPackage, then it is reduced to a SequenceExtent. If it is a SequenceExtent containing a single item, then it is reduced to that item. One consequence that is exploited by class FilterExpression is that if the value is a singleton numeric value, then the result will be an instance of NumericValue <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../../net/sf/saxon/value/Value.html#reduce()">reduce</A></CODE> in class <CODE><A HREF="../../../../net/sf/saxon/value/Value.html" title="class in net.sf.saxon.value">Value</A><<A HREF="../../../../net/sf/saxon/value/Closure.html" title="type parameter in Closure">T</A> extends <A HREF="../../../../net/sf/saxon/om/Item.html" title="interface in net.sf.saxon.om">Item</A>></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the value in simplified form <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../net/sf/saxon/trans/XPathException.html" title="class in net.sf.saxon.trans">XPathException</A></CODE> - if an error occurs</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../net/sf/saxon/value/Cardinality.html" title="class in net.sf.saxon.value"><B>PREV CLASS</B></A> <A HREF="../../../../net/sf/saxon/value/DateTimeValue.html" title="class in net.sf.saxon.value"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/saxon/value/Closure.html" target="_top"><B>FRAMES</B></A> <A HREF="Closure.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright (c) 2004-2011 Saxonica Limited. All rights reserved. </BODY> </HTML>