Package de.obqo.decycle.model
Class Edge
- java.lang.Object
-
- de.obqo.decycle.model.Edge
-
- All Implemented Interfaces:
java.lang.Comparable<Edge>
public class Edge extends java.lang.Object implements java.lang.Comparable<Edge>
AnEdgerepresents the connection between twonodes.There are two types of edges:
-
An edge having the
labelREFERENCESrepresents a dependency from nodefromto nodeto. For example a node for classAreferences a node for classBifAreferences (uses, depends on)B. Similar a package or slice will reference another package or slice if they contain at least one pair of class nodes that reference each other. Thefromandtonodes of areferencingedge will always have the samenode type. -
An edge having the
labelCONTAINSreflects that nodefromcontains nodeto. Typically a package or slice node contains a class node if the class belongs to the package or slice. Thefromandtonodes of acontainingedge will always have differentnode types.
referencingedge may have itsignoredflag set totrue. In this case this edge is not considered when checking any dependency violations between packages or slices.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEdge.EdgeLabel
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<Edge>COMPARATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)voidcombine(Edge edge)intcompareTo(Edge other)static Edgecontains(Node from, Node to)java.lang.StringdisplayString()booleanequals(java.lang.Object o)NodegetFrom()Edge.EdgeLabelgetLabel()NodegetTo()intgetWeight()inthashCode()booleanisContaining()booleanisIgnored()booleanisIncluded()booleanisReferencing()booleanisViolating()static Edgereferences(Node from, Node to)static Edgereferences(Node from, Node to, boolean ignored)voidsetViolating()
-
-
-
Field Detail
-
COMPARATOR
public static final java.util.Comparator<Edge> COMPARATOR
-
-
Method Detail
-
isReferencing
public boolean isReferencing()
-
isContaining
public boolean isContaining()
-
combine
public void combine(Edge edge)
-
setViolating
public void setViolating()
-
isIncluded
public boolean isIncluded()
-
displayString
public java.lang.String displayString()
-
compareTo
public int compareTo(Edge other)
- Specified by:
compareToin interfacejava.lang.Comparable<Edge>
-
getFrom
public Node getFrom()
-
getTo
public Node getTo()
-
getLabel
public Edge.EdgeLabel getLabel()
-
isIgnored
public boolean isIgnored()
-
getWeight
public int getWeight()
-
isViolating
public boolean isViolating()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-