|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ItemSequence
Sequence of Items returned by the evaluation of a XQuery Expression.
It can be used as input if bound to a variable of an expression.
Attention: the expansion of a result sequence through moveToNextItem or moveTo can cause runtime errors (EvaluationException) due to lazy - or late - evaluation mechanisms used in Qizx.
Method Summary | |
---|---|
void |
close()
Closes the sequence after use, and releases resources immediately, instead of waiting for this to happen automatically. |
long |
countItems()
Returns the total number of items, without moving the current position. |
long |
estimatedDocumentCount()
Returns an estimation of the number of Documents returned by this sequence. |
long |
estimatedDocumentCount(int minimalPosition)
Returns an estimation of the number of Documents returned by this sequence. |
Item |
getCurrentItem()
Returns the current item of the sequence. |
Expression |
getExpression()
Returns the Expression the evaluation of which this sequence is the result. |
double |
getFulltextScore()
Returns the full-text score, if applicable. |
long |
getPosition()
Returns the current position. |
List<Profiling> |
getProfilingAnnotations()
Returns a list of Profiling annotations when the query was executed through the profile() method. |
void |
moveTo(long position)
Moves the current position to the specified value. |
boolean |
moveToNextItem()
Moves to the next item. |
int |
skip(int count)
Skips items in forward direction. |
Methods inherited from interface com.qizx.api.Item |
---|
export, exportNode, getBoolean, getDecimal, getDouble, getFloat, getInteger, getNode, getObject, getQName, getString, getType, isNode |
Method Detail |
---|
boolean moveToNextItem() throws EvaluationException
ItemSequence seq = ...; while(seq.moveToNextItem()) { Item item = seq.getCurrentItem(); // process item... }
Attention: if access control is enabled, a result item belonging to a blocked document is silently discarded.
getCurrentItem()
).
EvaluationException
Item getCurrentItem()
long countItems() throws EvaluationException
Uses lazy evaluation if possible.
This method does not take into account items forbidden by Access Control (change from v2.1).
EvaluationException
- if the expansion of the sequence caused a
runtime errorlong estimatedDocumentCount() throws EvaluationException
The value returned by this method is the same as calling
estimatedDocumentCount(int)
with an argument of 100. See the
latter method for more details.
This method is cached, i.e it does not recompute the value if called several times.
EvaluationException
- if the expansion of the sequence caused a
runtime errorlong estimatedDocumentCount(int minimalPosition) throws EvaluationException
The estimated count provided by this method is valid under the following conditions:
minimalPosition
- the minimal position to reach before doint the estimation
EvaluationException
- if the expansion of the sequence caused a
runtime errorvoid moveTo(long position) throws EvaluationException
Attention: if the sequence is returned by an XQuery expression evaluation, moving backwards involves reevaluating the expression and therefore can be inefficient and potentially have side-effects if extension functions are used in the expression.
position
- number of items before desired position: moveTo(0) is
equivalent to rewind.
EvaluationException
- if the expansion of the sequence caused a
runtime errorlong getPosition()
getCurrentItem()
).
double getFulltextScore() throws EvaluationException
If this sequence is produced by evaluating an XQuery expression that
contains a ftcontains
operator, then the value returned
is the score of the current document evaluated against the
top-level full-text selection. Otherwise the value returned is 0.
This is the value returned by the score clause of
for
and let
.
ftcontains
expression.
EvaluationException
int skip(int count) throws EvaluationException
Performs lazy evaluation if possible.
count
- number of items to skip. Must be >= 0 otherwise ignored.
count
if the end of the sequence is reached.
EvaluationException
- if the expansion of the sequence caused a
runtime errorvoid close()
It is recommended to call this method when a sequence is no more needed. Failing to do so could result into errors due to an excess of used up resources.
The sequence can no more be used after calling this method. Calling this method twice has no effect.
Expression getExpression()
When the sequence is not the result of Expression.evaluate()
,
this method returns null.
List<Profiling> getProfilingAnnotations()
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |