Package net.sf.saxon.ma.jnode
Class JNodeForMapEntry
java.lang.Object
net.sf.saxon.ma.jnode.JNode
net.sf.saxon.ma.jnode.ChildJNode
net.sf.saxon.ma.jnode.JNodeForMapEntry
- All Implemented Interfaces:
GNode,GroundedValue,Item,Sequence,SiblingCountingNode
A child JNode that wraps an entry in a map
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.saxon.ma.jnode.ChildJNode
ChildJNode.JNodeChildIterator -
Field Summary
Fields inherited from class net.sf.saxon.ma.jnode.ChildJNode
parent, position, selector, value -
Constructor Summary
ConstructorsConstructorDescriptionJNodeForMapEntry(JNode parent, int position, AtomicValue selector, GroundedValue value, int serialNr) Create a JNode wrapping an entry in a map -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintcompareOrder(GNode other) Compare document order of this node against another node.booleanvoidgenerateId(StringBuilder buffer) Construct a character string that uniquely identifies this node.intGet the index position of this node among its siblings (starting from 0)inthashCode()iterateFollowingSiblingAxis(NodePredicate predicate) Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.iteratePrecedingSiblingAxis(NodePredicate predicate) Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.Methods inherited from class net.sf.saxon.ma.jnode.ChildJNode
getContent, getParent, getPosition, getSelector, iterateChildAxisMethods inherited from class net.sf.saxon.ma.jnode.JNode
atomize, getGenre, getNodeKind, getRoot, getUnicodeStringValue, hasChildNodes, toShortString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.GNode
getNodeKind, getParent, hasChildNodes, iterateAncestorAxis, iterateAncestorOrSelfAxis, iterateAttributeAxis, iterateChildAxis, iterateDescendantAxis, iterateDescendantOrSelfAxis, iterateFollowingAxis, iterateFollowingOrSelfAxis, iterateFollowingSiblingOrSelfAxis, iterateNamespaceAxis, iterateParentAxis, iteratePrecedingAxis, iteratePrecedingOrSelfAxis, iteratePrecedingSiblingOrSelfAxis, iterateSelfAxisMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
atomize, getGenre, getLabel, getLength, getStringValue, getUnicodeStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence, toShortStringMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
JNodeForMapEntry
public JNodeForMapEntry(JNode parent, int position, AtomicValue selector, GroundedValue value, int serialNr) Create a JNode wrapping an entry in a map- Parameters:
parent- the JNode whose content includes the containing mapposition- the 1-based position of the containing map within the content of the parentselector- the key of the relevant map entry within its containing mapvalue- the value corresponding to this keyserialNr- a sequential number representing the sibling position of this entry; may be -1 if not initially known
-
-
Method Details
-
getSiblingPosition
public int getSiblingPosition()Get the index position of this node among its siblings (starting from 0)- Specified by:
getSiblingPositionin interfaceSiblingCountingNode- Returns:
- 0 for the first child, 1 for the second child, etc.
-
iterateFollowingSiblingAxis
Get an iterator over the following-sibling axis, starting at this node; the nodes will be in document order.- Specified by:
iterateFollowingSiblingAxisin interfaceGNode- Specified by:
iterateFollowingSiblingAxisin classChildJNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
iteratePrecedingSiblingAxis
Get an iterator over the preceding-sibling axis, starting at this node; the nodes will be in reverse document order.- Specified by:
iteratePrecedingSiblingAxisin interfaceGNode- Specified by:
iteratePrecedingSiblingAxisin classChildJNode- Parameters:
predicate- a condition that the nodes must satisfy, or null- Returns:
- the required iterator
-
compareOrder
Compare document order of this node against another node.The other node must always be in the same tree; the effect of calling this method when the two nodes are in different trees is undefined. To obtain a global ordering of nodes, the application should first compare the result of getDocumentNumber(), and only if the document number is the same should compareOrder() be called.
- Specified by:
compareOrderin interfaceGNode- Parameters:
other- the other node- Returns:
- -1 if this node precedes the other, 0 if they are the same node, +1 if this node follows the other
-
equals
-
hashCode
public int hashCode() -
allocateSerialNr
protected void allocateSerialNr() -
generateId
Construct a character string that uniquely identifies this node. Note: a.isSameNode(b) if and only if generateId(a)==generateId(b)- Specified by:
generateIdin interfaceGNode- Parameters:
buffer- a buffer which will be updated to hold a string that uniquely identifies this node, across all documents.- Since:
- 8.7
Changed in Saxon 8.7 to generate the ID value in a client-supplied buffer
-