public class AncestorOrSelfDependencyNodeFilter extends java.lang.Object implements DependencyNodeFilter
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<DependencyNode> |
descendantNodes
The list of nodes that this filter accepts ancestors-or-self of.
|
| Constructor and Description |
|---|
AncestorOrSelfDependencyNodeFilter(DependencyNode descendantNode) |
AncestorOrSelfDependencyNodeFilter(java.util.List<DependencyNode> descendantNodes)
Creates a dependency node filter that only accepts nodes that are ancestors of, or equal to, the specified list
of nodes.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(DependencyNode node)
Gets whether this filter accepts the specified dependency node.
|
private boolean |
isAncestorOrSelf(DependencyNode ancestorNode,
DependencyNode descendantNode)
Gets whether the first dependency node is an ancestor-or-self of the second.
|
private final java.util.List<DependencyNode> descendantNodes
public AncestorOrSelfDependencyNodeFilter(DependencyNode descendantNode)
public AncestorOrSelfDependencyNodeFilter(java.util.List<DependencyNode> descendantNodes)
descendantNodes - the list of nodes to accept ancestors-or-self ofpublic boolean accept(DependencyNode node)
accept in interface DependencyNodeFilternode - the dependency node to checktrue if this filter accepts the specified dependency nodeprivate boolean isAncestorOrSelf(DependencyNode ancestorNode, DependencyNode descendantNode)
ancestorNode - the ancestor-or-self dependency nodedescendantNode - the dependency node to testtrue if ancestorNode is an ancestor, or equal to, descendantNode