Package org.javarosa.xpath
Class XPathLazyNodeset
java.lang.Object
org.javarosa.xpath.XPathNodeset
org.javarosa.xpath.XPathLazyNodeset
public class XPathLazyNodeset extends XPathNodeset
Represents a set of XPath nodes returned from a path or other operation which acts on multiple
paths.
Current encompasses two states.
1) A nodeset which references between 0 and N nodes which are known about (but, for instance,
don't match any predicates or are irrelevant). Some operations cannot be evaluated in this state
directly. If more than one node is referenced, it is impossible to return a normal evaluation, for
instance.
2) A nodeset which wasn't able to reference into any known model (generally a reference which is
written in error). In this state, the size of the nodeset can be evaluated, but the acual reference
cannot be returned, since it doesn't have any semantic value.
(2) may be a deviation from normal XPath. This should be evaluated in the future.
- Author:
- ctsims
-
Field Summary
-
Constructor Summary
Constructors Constructor Description XPathLazyNodeset(TreeReference unExpandedRef, DataInstance instance, EvaluationContext ec)Construct an XPath nodeset. -
Method Summary
Modifier and Type Method Description TreeReferencegetRefAt(int i)protected List<TreeReference>getReferences()ObjectgetValAt(int i)protected StringnodeContents()intsize()Object[]toArgList()Objectunpack()Methods inherited from class org.javarosa.xpath.XPathNodeset
ConstructInvalidPathNodeset, getInvalidNodesetException, getNonEmptySize, setReferences, shuffle, shuffle
-
Constructor Details
-
XPathLazyNodeset
Construct an XPath nodeset.- Parameters:
nodes-instance-ec-
-
-
Method Details
-
unpack
- Overrides:
unpackin classXPathNodeset- Returns:
- The value represented by this xpath. Can only be evaluated when this xpath represents exactly one reference, or when it represents 0 references after a filtering operation (a reference which _could_ have existed, but didn't, rather than a reference which could not represent a real node).
-
toArgList
- Overrides:
toArgListin classXPathNodeset
-
getReferences
- Overrides:
getReferencesin classXPathNodeset
-
size
public int size()- Overrides:
sizein classXPathNodeset
-
getRefAt
- Overrides:
getRefAtin classXPathNodeset
-
getValAt
- Overrides:
getValAtin classXPathNodeset
-
nodeContents
- Overrides:
nodeContentsin classXPathNodeset
-