com.gargoylesoftware.htmlunit.javascript.host
Class XPathResult

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.XPathResult
All Implemented Interfaces:
Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class XPathResult
extends SimpleScriptable

A JavaScript object for XPathResult.

Version:
$Revision: 5301 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static int ANY_TYPE
          This code does not represent a specific type.
static int ANY_UNORDERED_NODE_TYPE
          The result is a node set and will be accessed as a single node, which may be null if the node set is empty.
static int BOOLEAN_TYPE
          The result is a boolean.
static int FIRST_ORDERED_NODE_TYPE
          The result is a node set and will be accessed as a single node, which may be null if the node set is empty.
static int NUMBER_TYPE
          The result is a number.
static int ORDERED_NODE_ITERATOR_TYPE
          The result is a node set that will be accessed iteratively, which will produce document-ordered nodes.
static int ORDERED_NODE_SNAPSHOT_TYPE
          The result is a node set that will be accessed as a snapshot list of nodes that will be in original document order.
static int STRING_TYPE
          The result is a string.
static int UNORDERED_NODE_ITERATOR_TYPE
          The result is a node set that will be accessed iteratively, which may not produce nodes in a particular order.
static int UNORDERED_NODE_SNAPSHOT_TYPE
          The result is a node set that will be accessed as a snapshot list of nodes that may not be in a particular order.
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
XPathResult()
           
 
Method Summary
 Node jsxFunction_iterateNext()
          Iterates and returns the next node from the node set or null if there are no more nodes.
 Node jsxFunction_snapshotItem(int index)
          Returns the indexth item in the snapshot collection.
 boolean jsxGet_booleanValue()
          Returns the value of this boolean result.
 double jsxGet_numberValue()
          Returns the value of this number result.
 int jsxGet_resultType()
          The code representing the type of this result, as defined by the type constants.
 Node jsxGet_singleNodeValue()
          The value of this single node result, which may be null.
 int jsxGet_snapshotLength()
          The number of nodes in the result snapshot.
 String jsxGet_stringValue()
          Returns the value of this string result.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ANY_TYPE

public static final int ANY_TYPE
This code does not represent a specific type. An evaluation of an XPath expression will never produce this type. If this type is requested, then the evaluation returns whatever type naturally results from evaluation of the expression.

See Also:
Constant Field Values

NUMBER_TYPE

public static final int NUMBER_TYPE
The result is a number.

See Also:
Constant Field Values

STRING_TYPE

public static final int STRING_TYPE
The result is a string.

See Also:
Constant Field Values

BOOLEAN_TYPE

public static final int BOOLEAN_TYPE
The result is a boolean.

See Also:
Constant Field Values

UNORDERED_NODE_ITERATOR_TYPE

public static final int UNORDERED_NODE_ITERATOR_TYPE
The result is a node set that will be accessed iteratively, which may not produce nodes in a particular order. This is the default type returned if the result is a node set and ANY_TYPE is requested.

See Also:
Constant Field Values

ORDERED_NODE_ITERATOR_TYPE

public static final int ORDERED_NODE_ITERATOR_TYPE
The result is a node set that will be accessed iteratively, which will produce document-ordered nodes.

See Also:
Constant Field Values

UNORDERED_NODE_SNAPSHOT_TYPE

public static final int UNORDERED_NODE_SNAPSHOT_TYPE
The result is a node set that will be accessed as a snapshot list of nodes that may not be in a particular order.

See Also:
Constant Field Values

ORDERED_NODE_SNAPSHOT_TYPE

public static final int ORDERED_NODE_SNAPSHOT_TYPE
The result is a node set that will be accessed as a snapshot list of nodes that will be in original document order.

See Also:
Constant Field Values

ANY_UNORDERED_NODE_TYPE

public static final int ANY_UNORDERED_NODE_TYPE
The result is a node set and will be accessed as a single node, which may be null if the node set is empty. If there is more than one node in the actual result, the single node returned might not be the first in document order.

See Also:
Constant Field Values

FIRST_ORDERED_NODE_TYPE

public static final int FIRST_ORDERED_NODE_TYPE
The result is a node set and will be accessed as a single node, which may be null if the node set is empty. If there are more than one node in the actual result, the single node returned will be the first in document order.

See Also:
Constant Field Values
Constructor Detail

XPathResult

public XPathResult()
Method Detail

jsxGet_resultType

public int jsxGet_resultType()
The code representing the type of this result, as defined by the type constants.

Returns:
the code representing the type of this result

jsxGet_snapshotLength

public int jsxGet_snapshotLength()
The number of nodes in the result snapshot.

Returns:
the number of nodes in the result snapshot

jsxGet_singleNodeValue

public Node jsxGet_singleNodeValue()
The value of this single node result, which may be null.

Returns:
the value of this single node result, which may be null

jsxFunction_iterateNext

public Node jsxFunction_iterateNext()
Iterates and returns the next node from the node set or null if there are no more nodes.

Returns:
the next node

jsxFunction_snapshotItem

public Node jsxFunction_snapshotItem(int index)
Returns the indexth item in the snapshot collection. If index is greater than or equal to the number of nodes in the list, this method returns null.

Parameters:
index - Index into the snapshot collection
Returns:
the node at the indexth position in the NodeList, or null if that is not a valid index

jsxGet_numberValue

public double jsxGet_numberValue()
Returns the value of this number result.

Returns:
the value of this number result

jsxGet_booleanValue

public boolean jsxGet_booleanValue()
Returns the value of this boolean result.

Returns:
the value of this boolean result

jsxGet_stringValue

public String jsxGet_stringValue()
Returns the value of this string result.

Returns:
the value of this string result


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.