|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.dom.NodeSet
Base class for all node set implementations returned by most xpath expressions. It implements NodeList plus some additional methods needed by the xpath engine. There are three classes extending NodeSet: NodeIDSet, ArraySet and VirtualNodeSet. Depending on the context each of these implementations has its advantages and drawbacks. ArraySet uses a sorted array and binary search, while NodeIDSet is based on a HashSet. VirtualNodeSet is specifically used for steps like descendant::* etc..
Field Summary | |
static int |
ANCESTOR
|
static int |
DESCENDANT
|
static NodeSet |
EMPTY_SET
|
static int |
FOLLOWING
|
static int |
PRECEDING
|
Constructor Summary | |
NodeSet()
|
Method Summary | |
void |
add(DocumentImpl doc,
long nodeId)
|
void |
add(org.w3c.dom.Node node)
|
void |
add(NodeProxy proxy)
|
void |
addAll(org.w3c.dom.NodeList other)
|
abstract void |
addAll(NodeSet other)
|
boolean |
contains(DocumentImpl doc)
|
abstract boolean |
contains(DocumentImpl doc,
long nodeId)
|
abstract boolean |
contains(NodeProxy proxy)
|
abstract NodeProxy |
get(DocumentImpl doc,
long nodeId)
|
abstract NodeProxy |
get(int pos)
|
abstract NodeProxy |
get(NodeProxy p)
|
NodeSet |
getAncestors(NodeSet al,
boolean includeSelf,
boolean rememberContext)
For a given set of potential ancestor nodes, get the descendants in this node set |
ArraySet |
getChildren(NodeSet al,
int mode)
|
ArraySet |
getChildren(NodeSet al,
int mode,
boolean rememberContext)
|
NodeSet |
getContextNodes(NodeSet contextNodes,
boolean rememberContext)
|
NodeSet |
getDescendants(NodeSet al,
int mode)
|
NodeSet |
getDescendants(NodeSet al,
int mode,
boolean includeSelf)
|
NodeSet |
getDescendants(NodeSet al,
int mode,
boolean includeSelf,
boolean rememberContext)
For a given set of potential ancestor nodes, get the descendants in this node set |
abstract int |
getLength()
|
NodeSet |
getParents()
|
NodeSet |
getRange(DocumentImpl doc,
long lower,
long upper)
|
NodeSet |
getSiblings(NodeSet siblings,
int mode)
Select all nodes from the passed node set, which are preceding or following siblings of the nodes in this set. |
boolean |
hasIndex()
|
NodeSet |
intersection(NodeSet other)
|
abstract org.w3c.dom.Node |
item(int pos)
|
abstract java.util.Iterator |
iterator()
|
NodeProxy |
nodeHasParent(DocumentImpl doc,
long gid,
boolean directParent,
boolean includeSelf)
|
NodeProxy |
nodeHasParent(DocumentImpl doc,
long gid,
boolean directParent,
boolean includeSelf,
int level)
Check if node has a parent contained in this node set. |
NodeProxy |
nodeHasParent(NodeProxy p,
boolean directParent)
|
NodeProxy |
nodeHasParent(NodeProxy p,
boolean directParent,
boolean includeSelf)
|
NodeProxy |
parentWithChild(DocumentImpl doc,
long gid,
boolean directParent)
Search for a node contained in this node set, which is an ancestor of the argument node. |
NodeProxy |
parentWithChild(DocumentImpl doc,
long gid,
boolean directParent,
boolean includeSelf)
|
protected NodeProxy |
parentWithChild(DocumentImpl doc,
long gid,
boolean directParent,
boolean includeSelf,
int level)
Search for a node contained in this node set, which is an ancestor of the argument node. |
NodeProxy |
parentWithChild(NodeProxy proxy,
boolean directParent,
boolean includeSelf)
|
void |
remove(NodeProxy node)
|
NodeSet |
union(NodeSet other)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ANCESTOR
public static final int DESCENDANT
public static final int PRECEDING
public static final int FOLLOWING
public static NodeSet EMPTY_SET
Constructor Detail |
public NodeSet()
Method Detail |
public abstract java.util.Iterator iterator()
public abstract boolean contains(DocumentImpl doc, long nodeId)
public abstract boolean contains(NodeProxy proxy)
public boolean contains(DocumentImpl doc)
public void add(DocumentImpl doc, long nodeId)
public void add(org.w3c.dom.Node node)
public void add(NodeProxy proxy)
public void addAll(org.w3c.dom.NodeList other)
public abstract void addAll(NodeSet other)
public void remove(NodeProxy node)
public abstract int getLength()
getLength
in interface org.w3c.dom.NodeList
public abstract org.w3c.dom.Node item(int pos)
item
in interface org.w3c.dom.NodeList
public abstract NodeProxy get(int pos)
public abstract NodeProxy get(NodeProxy p)
public abstract NodeProxy get(DocumentImpl doc, long nodeId)
public NodeProxy nodeHasParent(NodeProxy p, boolean directParent)
public NodeProxy nodeHasParent(NodeProxy p, boolean directParent, boolean includeSelf)
public NodeProxy nodeHasParent(DocumentImpl doc, long gid, boolean directParent, boolean includeSelf)
public NodeProxy nodeHasParent(DocumentImpl doc, long gid, boolean directParent, boolean includeSelf, int level)
public ArraySet getChildren(NodeSet al, int mode)
public ArraySet getChildren(NodeSet al, int mode, boolean rememberContext)
public NodeSet getDescendants(NodeSet al, int mode)
public NodeSet getDescendants(NodeSet al, int mode, boolean includeSelf)
public NodeSet getDescendants(NodeSet al, int mode, boolean includeSelf, boolean rememberContext)
al
- node set containing potential ancestorsmode
- determines if either the ancestor or the descendant
nodes should be returned. Possible values are ANCESTOR or DESCENDANT.
public NodeSet getAncestors(NodeSet al, boolean includeSelf, boolean rememberContext)
al
- node set containing potential ancestors
public NodeSet getSiblings(NodeSet siblings, int mode)
siblings
- a node set containing potential siblingsmode
- either FOLLOWING or PRECEDING
public NodeProxy parentWithChild(DocumentImpl doc, long gid, boolean directParent)
public NodeProxy parentWithChild(DocumentImpl doc, long gid, boolean directParent, boolean includeSelf)
protected NodeProxy parentWithChild(DocumentImpl doc, long gid, boolean directParent, boolean includeSelf, int level)
public NodeProxy parentWithChild(NodeProxy proxy, boolean directParent, boolean includeSelf)
public NodeSet getParents()
public boolean hasIndex()
public NodeSet getRange(DocumentImpl doc, long lower, long upper)
public NodeSet intersection(NodeSet other)
public NodeSet union(NodeSet other)
public NodeSet getContextNodes(NodeSet contextNodes, boolean rememberContext)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |