public interface HasParentNode<T> extends Observable
Modifier and Type | Method and Description |
---|---|
default <N> Optional<N> |
findAncestor(Class<N> type)
Walks the parents of this node and returns the first node of type
type , or empty() if none is
found. |
default <N> Optional<N> |
findAncestor(Class<N> type,
Predicate<N> predicate)
Walks the parents of this node and returns the first node of type
type that matches predicate , or
empty() if none is found. |
Optional<Node> |
getParentNode()
Returns the parent node, or
Optional.empty if no parent is set. |
Node |
getParentNodeForChildren()
Returns the parent node from the perspective of the children of this node.
|
T |
setParentNode(Node parentNode)
Sets the parent node.
|
isRegistered, register, unregister
Optional<Node> getParentNode()
Optional.empty
if no parent is set.T setParentNode(Node parentNode)
parentNode
- the parent node, or null
to set no parent.this
Node getParentNodeForChildren()
That is, this method returns this
for everything except NodeList
. A NodeList
returns its
parent node instead. This is because a NodeList
sets the parent of all its children to its own parent
node (see NodeList
for details).
default <N> Optional<N> findAncestor(Class<N> type)
type
, or empty()
if none is
found. The given type may also be an interface type, such as one of the NodeWith...
interface types.default <N> Optional<N> findAncestor(Class<N> type, Predicate<N> predicate)
type
that matches predicate
, or
empty()
if none is found. The given type may also be an interface type, such as one of the
NodeWith...
interface types.Copyright © 2007–2019. All rights reserved.