Class Edge

  • All Implemented Interfaces:
    java.lang.Comparable<Edge>

    public class Edge
    extends java.lang.Object
    implements java.lang.Comparable<Edge>
    An Edge represents the connection between two nodes.

    There are two types of edges:

    • An edge having the label REFERENCES represents a dependency from node from to node to. For example a node for class A references a node for class B if A references (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. The from and to nodes of a referencing edge will always have the same node type.
    • An edge having the label CONTAINS reflects that node from contains node to. Typically a package or slice node contains a class node if the class belongs to the package or slice. The from and to nodes of a containing edge will always have different node types.
    A referencing edge may have its ignored flag set to true. In this case this edge is not considered when checking any dependency violations between packages or slices.
    • Method Detail

      • references

        public static Edge references​(Node from,
                                      Node to,
                                      boolean ignored)
      • references

        public static Edge references​(Node from,
                                      Node to)
      • contains

        public static Edge contains​(Node from,
                                    Node to)
      • isReferencing

        public boolean isReferencing()
      • isContaining

        public boolean isContaining()
      • ignore

        public void ignore​(boolean ignored)
      • compareTo

        public int compareTo​(Edge other)
        Specified by:
        compareTo in interface java.lang.Comparable<Edge>
      • getFrom

        public Node getFrom()
      • getTo

        public Node getTo()
      • isIgnored

        public boolean isIgnored()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object