LocalNodeObject

Oracle recommends that you use the various xxxWith functions to locate other nodes in the hierarchy. For example ChildrenWith executes much faster than calling GetChildren() and iterating the results. Similarly, GetReferenceInHier is much faster and easier to use than calling GetReferences() and iterating the results.

Table 24. LocalNodeObject Properties

Name

Description

GlobalNode

Global NodeObject for the current node

Hier

HierarchyObject for the hierarchy the node is in

HierAbbrev

Core.HierAbbrev

HierID

Core.HierID

Level

Number representing the node’s level in the hierarchy

MissingPrimary

True if the primary node is not found

NodeUrl

Node URL

Parent

LocalNodeObject for the parent node of this node. Null is returned for the top node of a hierarchy.

ParentNodeAbbrev

Name of parent node

Primary

The primary node for this shared node. If the primary is not in this hierarchy, returns the primary in the first hierarchy in which it occurs. If you need the list of hierarchies in which the primary appears, call GetReferences() on the returned primary node. If a shared node or primary cannot be found, returns null.

PrimaryNotInHier

True if the primary node exists but not in this hierarchy

Table 25. LocalNodeObject Methods

Name

Description

AncestorsWith(func, maxResults, searchFromTop, inclusive)

Searches the ancestor chain for nodes that satisfy the given function. This is the fastest way to locate ancestors. Returns an Array of LocalNodeObject results.

  • Func must be a function that takes a single node argument and returns True if the node should be included in the results or False if it fails the test.

  • maxResults is optional and defaults to 1. Use 0 for no limit (all nodes that pass the condition).

  • searchFromTop is optional and defaults to False. Use True to start at the top of the hierarchy.

  • inclusive is optional and defaults to False. Use True to include the current node in the potential matches (it must still pass the test).

ChildrenWith(func, maxResults)

Searches the node’s child list for nodes that satisfy the given function. This is the fastest way to find children. Returns an Array of LocalNodeObject results.

  • func must be a function that takes a single node argument and returns True if the node should be included in the results or False if it fails the test.

  • maxResults is optional and defaults to 1. Use 0 for no limit (all children that pass the condition).

DescendantsWith(func, maxResults, inclusive, depthFirst)

Searches the descendant chain for nodes that satisfy the given function. This is the fastest way to find descendants Returns an Array of LocalNodeObject results.

  • func must be a function that takes a single node argument and returns True if the node should be included in the results or False if it fails the test.

  • maxResults is optional and defaults to 1. Use 0 for no limit (all nodes that pass the condition).

  • inclusive is optional and defaults to False. Use True to include the current node in the potential matches (it must still pass the test).

  • depthFirst is optional and defaults to True. If True, each branch is examined all the way to its tips before backing up the tree and moving to the next branch. If False, all the children of a node are examined first, then each child's nodes are examined, and so on. If you have a good idea of where the node may be in the tree, picking the correct value here can greatly speed up the search.

GetAncestorEnumerator()

Gets a NodeEnumeratorObject that enumerates the ancestor nodes

GetAncestors(inclusive)

Gets an Array of LocalNodeObject ancestors

GetChildEnumerator(sorted)

Gets a NodeEnumeratorObject that enumerates the child nodes. If sorted is True, then the children will be in sorted order.

GetDescendantEnumerator()

Gets a NodeEnumeratorObject that enumerates the descendant nodes

GetImplicitly SharedDescendants(inclusive)

Gets the child nodes of the primary node this shared node is related to

GetInvertedLevel()

Equivalent to the formula InvertedLevel function

GetReferences()

Gets an Array of LocalNodeObjects that are references for this node (all hierarchies this node appears in)

GetReferenceInHier(hierAbbrev)

Gets the reference to this node in the given hierarchy. If the hierarchy is not accessible or this node does not exist in that hierarchy, then the result will be null.

NextSibling()

Gets the next sibling of this node in the sort order

PreviousSibling()

Gets the previous sibling of this node in the sort order

SiblingsWith(func, maxResults, inclusive)

Searches the node’s siblings for nodes that satisfy the given function. Returns an Array of LocalNodeObject results.

  • func must be a function that takes a single node argument and returns True if the node should be included in the results or False if it fails the test.

  • maxResults is optional and defaults to 1. Use 0 for no limit (all ancestors that pass the condition).

  • inclusive is optional and defaults to False. Use True to include the current node in the potential matches (it must still pass the test).