public class Node extends Object implements Comparable<Node>
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Node child,
Field childField,
Field thisField,
DependencyType dependencyType)
Similar to
addParent(Node, Field, Field, DependencyType) but creates an edge
with this node being the "from" and the child node being the "to" of the newly created edge. |
protected void |
addEdge(Edge edge)
This method is called from
addParent(Node, Field, Field, DependencyType) and
addChild(Node, Field, Field, DependencyType) methods to actually store an instance
of an edge in this instance's edge set. |
void |
addParent(Node parent,
Field parentField,
Field thisField,
DependencyType dependencyType)
Add a parent node.
|
int |
compareTo(Node o) |
boolean |
equals(Object other) |
SortedSet<Node> |
getChildren(boolean onlyExplicitRelations)
Returns the children of this node.
|
Set<Edge> |
getEdges() |
Class<?> |
getEntity()
The class of the JPA entity this node represents.
|
Set<Edge> |
getIncomingEdges() |
Set<Edge> |
getOutgoingEdges() |
SortedSet<Node> |
getParents(boolean onlyExplicitRelations)
Return the parents of this node.
|
SortedSet<Node> |
getTransitiveChildren(boolean onlyExplicitRelations)
Returns this node, its children, their children, etc.
|
SortedSet<Node> |
getTransitiveParents(boolean onlyExplicitRelations)
Returns this node, its parents, their parents, etc, recursively up the dependency graph.
|
EntityTranslation |
getTranslation() |
int |
hashCode() |
void |
setTranslation(EntityTranslation translation) |
String |
toString() |
public Node(Class<?> entity)
public Class<?> getEntity()
public EntityTranslation getTranslation()
public void setTranslation(EntityTranslation translation)
public void addParent(Node parent, Field parentField, Field thisField, DependencyType dependencyType)
parent - the parent nodeparentField - the field on the parent node's entity that the edge is to be linked withthisField - the field on this node's entity that the edge is to be linked withdependencyType - the type of the JPA dependencypublic void addChild(Node child, Field childField, Field thisField, DependencyType dependencyType)
addParent(Node, Field, Field, DependencyType) but creates an edge
with this node being the "from" and the child node being the "to" of the newly created edge.child - childField - thisField - dependencyType - protected void addEdge(Edge edge)
addParent(Node, Field, Field, DependencyType) and
addChild(Node, Field, Field, DependencyType) methods to actually store an instance
of an edge in this instance's edge set.edge - public Set<Edge> getOutgoingEdges()
public Set<Edge> getIncomingEdges()
public SortedSet<Node> getParents(boolean onlyExplicitRelations)
onlyExplicitRelations is true, then only
the edges that have and non-null "from" field are considered.
This means that only parents that explicitly link to this entity are considered.
A null from field means that the relation was only defined on the "to" side and that
the parent entity has no explicit knowledge of the relationship.onlyExplicitRelations - public SortedSet<Node> getChildren(boolean onlyExplicitRelations)
onlyExplicitRelations argument has the same meaning as for the getParents(boolean) method.onlyExplicitRelations - public SortedSet<Node> getTransitiveParents(boolean onlyExplicitRelations)
onlyExplicitRelations - the same meaning as for getParents(boolean)public SortedSet<Node> getTransitiveChildren(boolean onlyExplicitRelations)
onlyExplicitRelations - the same meaning as for getParents(boolean)public int compareTo(Node o)
compareTo in interface Comparable<Node>Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.