001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js.user;
021 
022 import js.*;
023 import js.core.*;
024 
025 /**
026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
027  * {@link JsClient#XPathResult} class.</p>
028  * <p>A {@link JsXPathResult} object represents the value of an XPath expression. Objects 
029  * of this type are returned by {@link JsDocument#evaluate(String, JsNode, JsFunction, Number, JsXPathResult)} 
030  * and {@link JsXPathExpression#evaluate(JsNode, Number, JsXPathResult)}. XPath queries 
031  * can evaluate to strings, numbers, booleans, nodes, and lists of nodes. XPath implementations 
032  * can return lists of nodes in several different ways, so this class defines a slightly 
033  * complex API for obtaining the actual result of an XPath query.</p>
034  * <p>To use a {@link JsXPathResult} object, first check the {@link JsXPathResult#resultType} 
035  * property. It will hold one of the {@link js.dom.DOM.XPathResult} constants. The value 
036  * of this property tells you which property or method you need to use to determine the 
037  * result value. Calling methods or reading properties that are not defined for the 
038  * current {@link JsXPathResult#resultType} causes an error.</p>
039  * <p>IE does not support the API of this class. To perform XPath queries in IE, see 
040  * {@link JsNode#selectNodes(String)} and {@link JsNode#selectSingleNode(String)}.</p>
041  *
042  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
043  * @see JsNode#selectNodes(String)
044  * @see JsNode#selectSingleNode(String)
045  *
046  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
047  * generated into the target codes. Re-compilers must exit with error on the operations of
048  * accessing that kind of class objects.
049  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
050  * and <tt>instanceof</tt> to it always <tt>true</tt>.
051  */
052 public class JsXPathResult extends JsClient.XPathResult.Prototype
053 {
054     /**
055      * <p>An <b>internal</b> class containing membership data for its enclosing
056      * opaque class.</p>
057      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
058      * class members.</p>
059      *
060      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
061      * 
062      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
063      */
064     protected static abstract class Members extends JsClient.XPathResult.Prototype.Members
065     {
066         /**
067          * <p>An <b>internal</b> static field defining a member ID of the field name and
068          * used internally to define a member of the same name.</p>
069          * @since 1.0
070          * @see JsXPathResult#booleanValue
071          * @see JsXPathResult.Member#booleanValue
072          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
073          */
074         public final static Mid booleanValue         = id("booleanValue"        );
075         /**
076          * <p>An <b>internal</b> static field defining a member ID of the field name and
077          * used internally to define a member of the same name.</p>
078          * @since 1.0
079          * @see JsXPathResult#invalidIteratorState
080          * @see JsXPathResult.Member#invalidIteratorState
081          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
082          */
083         public final static Mid invalidIteratorState = id("invalidIteratorState");
084         /**
085          * <p>An <b>internal</b> static field defining a member ID of the field name and
086          * used internally to define a member of the same name.</p>
087          * @since 1.0
088          * @see JsXPathResult#numberValue
089          * @see JsXPathResult.Member#numberValue
090          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
091          */
092         public final static Mid numberValue          = id("numberValue"         );
093         /**
094          * <p>An <b>internal</b> static field defining a member ID of the field name and
095          * used internally to define a member of the same name.</p>
096          * @since 1.0
097          * @see JsXPathResult#resultType
098          * @see JsXPathResult.Member#resultType
099          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
100          */
101         public final static Mid resultType           = id("resultType"          );
102         /**
103          * <p>An <b>internal</b> static field defining a member ID of the field name and
104          * used internally to define a member of the same name.</p>
105          * @since 1.0
106          * @see JsXPathResult#singleNodeValue
107          * @see JsXPathResult.Member#singleNodeValue
108          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
109          */
110         public final static Mid singleNodeValue      = id("singleNodeValue"     );
111         /**
112          * <p>An <b>internal</b> static field defining a member ID of the field name and
113          * used internally to define a member of the same name.</p>
114          * @since 1.0
115          * @see JsXPathResult#snapshotLength
116          * @see JsXPathResult.Member#snapshotLength
117          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
118          */
119         public final static Mid snapshotLength       = id("snapshotLength"      );
120         /**
121          * <p>An <b>internal</b> static field defining a member ID of the field name and
122          * used internally to define a member of the same name.</p>
123          * @since 1.0
124          * @see JsXPathResult#stringValue
125          * @see JsXPathResult.Member#stringValue
126          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
127          */
128         public final static Mid stringValue          = id("stringValue"         );
129     }
130 
131     /**
132      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
133      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
134      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
135      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
136      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
137      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
138      * either circumstance, the field names must be exactly same as the member names, as 
139      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
140      * based on the field names.</p>
141      *
142      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
143      * 
144      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
145      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
146      * of class objects.
147      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
148      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
149      * <pre>q.m</pre>
150      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
151      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
152      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
153      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
154      * <pre>m</pre>
155      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
156      * error on the access to <b>opaque</b> fields declared by this class under any other 
157      * circumstances.
158      */
159     public static class Member extends JsClient.XPathResult.Prototype.Member
160     {
161         /**
162          * <p>Internally constructs a member based on a qualifying member.</p>
163          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
164          * or <b>internal</b> classes or class members.</p>
165          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
166          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
167          * declared in the declaring class of this constructor itself or its subclasses. 
168          * Under this circumstance, the field names must be exactly same as the member 
169          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
170          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
171          * to their names appending to the name resolved from the specified qualifying 
172          * member with a dot in between.</p>
173          * @param q A qualifying member
174          * @param mid The ID of the member to construct
175          * @since 1.0
176          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
177          */
178         public Member(JsObject.Member q, Mid mid) {
179             super(q, mid);
180         }
181         /**
182          * <p>Internally constructs a member without a qualifying member.</p>
183          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
184          * or <b>internal</b> classes or class members.</p>
185          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
186          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
187          * declared in <b>opaque</b> types other than the declaring class of this constructor 
188          * itself and its subclasses. Under this circumstance, the field names must be
189          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
190          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
191          * @param mid The ID of the member to construct
192          * @since 1.0
193          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
194          */
195         public Member(Mid mid) {
196             super(mid);
197         }
198         @Override
199         /**
200          * <p>Evaluates the property, represented by the current member instance, of the
201          * argument object.</p>
202          * @param o The argument object
203          * @return The value of the current member based on the object argument.
204          * @since 1.0
205          * @javascript Re-compilers must convert the instance invocation of this method into
206          * the JavaScript expression: 
207          * <pre>o.m</pre>
208          * where <tt>m</tt> is the identifier name resolved from the current member
209          * instance of the invocation.
210          */
211         public JsXPathResult with(ObjectLike o) {
212             return new JsXPathResult(super.with(o));
213         }
214 
215         /**
216          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
217          * name of this field, qualified by the current member instance of the field, and 
218          * to access the property of the name on an object.</p>
219          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
220          * refers to a read-only boolean value holding the result value when {@link #resultType} 
221          * is {@link js.dom.DOM.XPathResult#BOOLEAN_TYPE}.</p> 
222          * @since 1.0
223          * @javascript Re-compilers must resolve the member of this instance field to the
224          * identifier of the field name appending to the identifier resolved from its 
225          * qualifying member with a dot in between.
226          */
227         public final Value.Boolean.Member booleanValue         = new Value.Boolean.Member(this, Members.booleanValue        );
228         /**
229          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
230          * name of this field, qualified by the current member instance of the field, and 
231          * to access the property of the name on an object.</p>
232          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
233          * refers to a read-only boolean value which is <tt>true</tt> if {@link #resultType} 
234          * is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_ITERATOR_TYPE} or {@link js.dom.DOM.XPathResult#ORDERED_NODE_ITERATOR_TYPE}, 
235          * and the document has been modified, making the iterator invalid, because the 
236          * result was returned.</p> 
237          * @since 1.0
238          * @javascript Re-compilers must resolve the member of this instance field to the
239          * identifier of the field name appending to the identifier resolved from its 
240          * qualifying member with a dot in between.
241          */
242         public final Value.Boolean.Member invalidIteratorState = new Value.Boolean.Member(this, Members.invalidIteratorState);
243         /**
244          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
245          * name of this field, qualified by the current member instance of the field, and 
246          * to access the property of the name on an object.</p>
247          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
248          * is a read-only reference to the result {@link JsNode} object when {@link #resultType} 
249          * is {@link js.dom.DOM.XPathResult#ANY_UNORDERED_NODE_TYPE} or {@link js.dom.DOM.XPathResult#FIRST_ORDERED_NODE_TYPE}.</p> 
250          * @since 1.0
251          * @javascript Re-compilers must resolve the member of this instance field to the
252          * identifier of the field name appending to the identifier resolved from its 
253          * qualifying member with a dot in between.
254          */
255         public final JsNode.Member singleNodeValue = new JsNode.Member(this, Members.singleNodeValue);
256         /**
257          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
258          * name of this field, qualified by the current member instance of the field, and 
259          * to access the property of the name on an object.</p>
260          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
261          * refers to a read-only number value holding the result value when {@link #resultType} 
262          * is {@link js.dom.DOM.XPathResult#NUMBER_TYPE}.</p> 
263          * @since 1.0
264          * @javascript Re-compilers must resolve the member of this instance field to the
265          * identifier of the field name appending to the identifier resolved from its 
266          * qualifying member with a dot in between.
267          */
268         public final Value.Number.Member numberValue    = new Value.Number.Member(this, Members.numberValue   );
269         /**
270          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
271          * name of this field, qualified by the current member instance of the field, and 
272          * to access the property of the name on an object.</p>
273          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
274          * refers to a read-only number specifying what kind of result the XPath query 
275          * returned and telling you which other properties or methods you can use. The 
276          * value is one of the constants defined by {@link JsClient#XPathResult}.</p> 
277          * @since 1.0
278          * @javascript Re-compilers must resolve the member of this instance field to the
279          * identifier of the field name appending to the identifier resolved from its 
280          * qualifying member with a dot in between.
281          */
282         public final Value.Number.Member resultType     = new Value.Number.Member(this, Members.resultType    );
283         /**
284          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
285          * name of this field, qualified by the current member instance of the field, and 
286          * to access the property of the name on an object.</p>
287          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
288          * refers to a read-only number specifying the number of nodes returned when 
289          * {@link #resultType} is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_SNAPSHOT_TYPE} or 
290          * {@link js.dom.DOM.XPathResult#ORDERED_NODE_SNAPSHOT_TYPE}. The property is 
291          * used in conjunction with {@link JsXPathResult#snapshotItem(Number)}.</p> 
292          * @since 1.0
293          * @javascript Re-compilers must resolve the member of this instance field to the
294          * identifier of the field name appending to the identifier resolved from its 
295          * qualifying member with a dot in between.
296          */
297         public final Value.Number.Member snapshotLength = new Value.Number.Member(this, Members.snapshotLength);
298         /**
299          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
300          * name of this field, qualified by the current member instance of the field, and 
301          * to access the property of the name on an object.</p>
302          * <p>The property, identified by this member, of a {@link JsXPathResult} object 
303          * refers to a read-only string value holding the result value when {@link #resultType} 
304          * is {@link js.dom.DOM.XPathResult#STRING_TYPE}.</p> 
305          * @since 1.0
306          * @javascript Re-compilers must resolve the member of this instance field to the
307          * identifier of the field name appending to the identifier resolved from its 
308          * qualifying member with a dot in between.
309          */
310         public final Value.String.Member stringValue    = new Value.String.Member(this, Members.stringValue   );
311     }
312 
313     /**
314      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
315      * with the wrapping constructor.</p>
316      * @param var The argument of an <b>opaque</b> object.
317      * @since 1.0
318      * @javascript Re-compilers must ignore the construction operation of this constructor,
319      * that is, replacing it with its only argument.
320      */
321     public JsXPathResult(JsObject var) {
322         super(var);
323     }
324 
325     /**
326      * <p>An <b>opaque</b> static field defining a member that is named by the field name
327      * without a qualifying member and to access the property of the name on an object.</p>
328      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
329      * refers to a read-only boolean value holding the result value when {@link #resultType} 
330      * is {@link js.dom.DOM.XPathResult#BOOLEAN_TYPE}.</p> 
331      * @since 1.0
332      * @javascript Re-compilers must resolve the member of this static field to the
333      * identifier of the field name.
334      */
335     public static final Value.Boolean.Member booleanValue         = new Value.Boolean.Member(Members.booleanValue        );
336     /**
337      * <p>An <b>opaque</b> static field defining a member that is named by the field name
338      * without a qualifying member and to access the property of the name on an object.</p>
339      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
340      * refers to a read-only boolean value which is <tt>true</tt> if {@link #resultType} 
341      * is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_ITERATOR_TYPE} or {@link js.dom.DOM.XPathResult#ORDERED_NODE_ITERATOR_TYPE}, 
342      * and the document has been modified, making the iterator invalid, because the 
343      * result was returned.</p> 
344      * @since 1.0
345      * @javascript Re-compilers must resolve the member of this static field to the
346      * identifier of the field name.
347      */
348     public static final Value.Boolean.Member invalidIteratorState = new Value.Boolean.Member(Members.invalidIteratorState);
349     /**
350      * <p>An <b>opaque</b> static field defining a member that is named by the field name
351      * without a qualifying member and to access the property of the name on an object.</p>
352      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
353      * is a read-only reference to the result {@link JsNode} object when {@link #resultType} 
354      * is {@link js.dom.DOM.XPathResult#ANY_UNORDERED_NODE_TYPE} or {@link js.dom.DOM.XPathResult#FIRST_ORDERED_NODE_TYPE}.</p> 
355      * @since 1.0
356      * @javascript Re-compilers must resolve the member of this static field to the
357      * identifier of the field name.
358      */
359     public static final JsNode.Member singleNodeValue = new JsNode.Member(Members.singleNodeValue);
360     /**
361      * <p>An <b>opaque</b> static field defining a member that is named by the field name
362      * without a qualifying member and to access the property of the name on an object.</p>
363      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
364      * refers to a read-only number value holding the result value when {@link #resultType} 
365      * is {@link js.dom.DOM.XPathResult#NUMBER_TYPE}.</p> 
366      * @since 1.0
367      * @javascript Re-compilers must resolve the member of this static field to the
368      * identifier of the field name.
369      */
370     public static final Value.Number.Member numberValue    = new Value.Number.Member(Members.numberValue   );
371     /**
372      * <p>An <b>opaque</b> static field defining a member that is named by the field name
373      * without a qualifying member and to access the property of the name on an object.</p>
374      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
375      * refers to a read-only number specifying what kind of result the XPath query 
376      * returned and telling you which other properties or methods you can use. The 
377      * value is one of the constants defined by {@link JsClient#XPathResult}.</p> 
378      * @since 1.0
379      * @javascript Re-compilers must resolve the member of this static field to the
380      * identifier of the field name.
381      */
382     public static final Value.Number.Member resultType     = new Value.Number.Member(Members.resultType    );
383     /**
384      * <p>An <b>opaque</b> static field defining a member that is named by the field name
385      * without a qualifying member and to access the property of the name on an object.</p>
386      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
387      * refers to a read-only number specifying the number of nodes returned when 
388      * {@link #resultType} is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_SNAPSHOT_TYPE} or 
389      * {@link js.dom.DOM.XPathResult#ORDERED_NODE_SNAPSHOT_TYPE}. The property is 
390      * used in conjunction with {@link #snapshotItem(Number)}.</p> 
391      * @since 1.0
392      * @javascript Re-compilers must resolve the member of this static field to the
393      * identifier of the field name.
394      */
395     public static final Value.Number.Member snapshotLength = new Value.Number.Member(Members.snapshotLength);
396     /**
397      * <p>An <b>opaque</b> static field defining a member that is named by the field name
398      * without a qualifying member and to access the property of the name on an object.</p>
399      * <p>The property, identified by this member, of a {@link JsXPathResult} object 
400      * refers to a read-only string value holding the result value when {@link #resultType} 
401      * is {@link js.dom.DOM.XPathResult#STRING_TYPE}.</p> 
402      * @since 1.0
403      * @javascript Re-compilers must resolve the member of this static field to the
404      * identifier of the field name.
405      */
406     public static final Value.String.Member stringValue    = new Value.String.Member(Members.stringValue   );
407 
408     @Override
409     /**
410      * <p>Returns the primitive value associated with the current instance, if there is one.
411      * This invocation simply returns the instance itself for the current instance is an 
412      * object and there is no primitive value for it.</p>
413      * @return The current object itself.
414      * @since 1.0
415      * @javascript Re-compilers must convert the instance invocation of this method directly
416      * into a JavaScript invocation on its current object instance without changing the 
417      * method name, but expanding variable arguments, if any, into comma-separated values. 
418      */
419     public JsXPathResult valueOf() {
420         return new JsXPathResult((JsObject)var().valueOf());
421     }
422     public final JsNode var(JsNode.Member r) {
423         return r.with(this);
424     }
425 
426     /**
427      * <p>Returns the next node in the node set.</p>
428      * <p>This method may be only if the {@link #resultType} is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_ITERATOR_TYPE} 
429      * or {@link js.dom.DOM.XPathResult#ORDERED_NODE_ITERATOR_TYPE}.</p>
430      * @return The next node in the list of matching nodes, or <tt>null</tt> if there 
431      * are no more.
432      * @since 1.0
433      * @javascript Re-compilers must convert the instance invocation of this method directly
434      * into a JavaScript invocation on its current object instance without changing the 
435      * method name, but expanding variable arguments, if any, into comma-separated values. 
436      */
437     public final JsNode iterateNext() {
438         return new JsNode(call(iterateNext));
439     }
440     /**
441      * <p>Returns the node at the specified index in the list of result nodes.</p>
442      * <p>This method may be used only if the {@link #resultType} is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_SNAPSHOT_TYPE} 
443      * or {@link js.dom.DOM.XPathResult#ORDERED_NODE_ITERATOR_TYPE}. Use this method in 
444      * conjunction with the {@link #snapshotLength} property.</p>
445      * @param index The index of the node to be returned.
446      * @return The node at the specified index, or <tt>null</tt> if the <tt>index</tt> 
447      * is less than zero or greater than or equal to {@link #snapshotLength}.
448      * @since 1.0
449      * @see #snapshotItem(NumberLike)
450      * @javascript Re-compilers must convert the instance invocation of this method directly
451      * into a JavaScript invocation on its current object instance without changing the 
452      * method name, but expanding variable arguments, if any, into comma-separated values. 
453      */
454     public final JsNode snapshotItem(Number index) {
455         return new JsNode(call(snapshotItem, index));
456     }
457     /**
458      * <p>Returns the node at the specified index in the list of result nodes.</p>
459      * <p>This method may be used only if the {@link #resultType} is {@link js.dom.DOM.XPathResult#UNORDERED_NODE_SNAPSHOT_TYPE} 
460      * or {@link js.dom.DOM.XPathResult#ORDERED_NODE_ITERATOR_TYPE}. Use this method in 
461      * conjunction with the {@link #snapshotLength} property.</p>
462      * @param index The index of the node to be returned.
463      * @return The node at the specified index, or <tt>null</tt> if the <tt>index</tt> 
464      * is less than zero or greater than or equal to {@link #snapshotLength}.
465      * @since 1.0
466      * @see #snapshotItem(Number)
467      * @javascript Re-compilers must convert the instance invocation of this method directly
468      * into a JavaScript invocation on its current object instance without changing the 
469      * method name, but expanding variable arguments, if any, into comma-separated values. 
470      */
471     public final JsNode snapshotItem(NumberLike<?> index) {
472         return new JsNode(call(snapshotItem, index));
473     }
474 }