public class DefaultGraphNode extends java.lang.Object implements SearchNode
Constructor and Description |
---|
DefaultGraphNode() |
DefaultGraphNode(SearchNode node) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(SearchEdge edge,
boolean incoming) |
void |
addEdges(java.util.Collection<SearchEdge> newEdges,
boolean incoming) |
int |
getChildCount()
Returns the minimum number of direct child nodes.
|
SearchConstraint[] |
getConstraints() |
int |
getDescendantCount()
Returns the number of nodes in the sub-tree whose root this
SearchNode is. |
int |
getHeight()
Returns the height of the sub-tree whose root node is this
SearchNode . |
java.lang.String |
getId() |
SearchEdge |
getIncomingEdgeAt(int index) |
int |
getIncomingEdgeCount() |
NodeType |
getNodeType() |
SearchEdge |
getOutgoingEdgeAt(int index) |
int |
getOutgoingEdgeCount() |
boolean |
isNegated() |
void |
setConstraints(SearchConstraint[] constraints) |
void |
setId(java.lang.String id) |
void |
setNegated(boolean negated) |
void |
setNodeType(NodeType nodeType) |
void |
sortEdges(java.util.Comparator<SearchEdge> comparator) |
public DefaultGraphNode()
public DefaultGraphNode(SearchNode node)
public SearchConstraint[] getConstraints()
getConstraints
in interface SearchNode
SearchNode.getConstraints()
public boolean isNegated()
isNegated
in interface SearchNode
SearchNode.isNegated()
public int getOutgoingEdgeCount()
getOutgoingEdgeCount
in interface SearchNode
SearchNode.getOutgoingEdgeCount()
public SearchEdge getOutgoingEdgeAt(int index)
getOutgoingEdgeAt
in interface SearchNode
SearchNode.getOutgoingEdgeAt(int)
public int getIncomingEdgeCount()
getIncomingEdgeCount
in interface SearchNode
SearchNode.getIncomingEdgeCount()
public SearchEdge getIncomingEdgeAt(int index)
getIncomingEdgeAt
in interface SearchNode
SearchNode.getIncomingEdgeAt(int)
public int getHeight()
SearchNode
SearchNode
.
For a leaf node this method must return 1
and for any
other node it is 1
plus the maximum of any of its child nodes height.getHeight
in interface SearchNode
SearchNode.getHeight()
public int getDescendantCount()
SearchNode
SearchNode
is.
This count does not include the node itself and is 0
for leaf nodes.getDescendantCount
in interface SearchNode
SearchNode.getDescendantCount()
public java.lang.String getId()
getId
in interface SearchNode
public void setId(java.lang.String id)
public void setConstraints(SearchConstraint[] constraints)
public void setNegated(boolean negated)
public NodeType getNodeType()
getNodeType
in interface SearchNode
SearchNode.getNodeType()
public void setNodeType(NodeType nodeType)
public void addEdge(SearchEdge edge, boolean incoming)
public void addEdges(java.util.Collection<SearchEdge> newEdges, boolean incoming)
public void sortEdges(java.util.Comparator<SearchEdge> comparator)
public int getChildCount()
SearchNode
getChildCount
in interface SearchNode
SearchNode.getChildCount()