Class Node

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

    public final class Node
    extends java.lang.Object
    implements java.lang.Comparable<Node>
    The class Node represents the nodes in a dependency and slice graph.

    During the analysis Decycle will create Node instances by calling classNode(String) that have the type SliceType.classType() for all classes and types it will encounter. After that Decycle will create Node instances for groups of class nodes. The first grouping level creates nodes with type SliceType.packageType() (by calling packageNode(String)) representing the packages of the analyzed classes. Then, if rules for slicings have been defined, custom slice nodes will be created using sliceNode(String, String), which use the name of the slicing as custom type.

    The name of a node is the class name, the package name, or the slice name.

    Nodes are connected to other nodes with edges.

    • Field Detail

      • COMPARATOR

        public static final java.util.Comparator<Node> COMPARATOR
    • Method Detail

      • classNode

        public static Node classNode​(java.lang.String name)
      • packageNode

        public static Node packageNode​(java.lang.String name)
      • sliceNode

        public static Node sliceNode​(java.lang.String type,
                                     java.lang.String name)
      • sliceNode

        public static Node sliceNode​(SliceType type,
                                     java.lang.String name)
      • hasType

        public boolean hasType​(SliceType type)
      • displayString

        public java.lang.String displayString()
      • compareTo

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

        @NonNull
        public @NonNull SliceType getType()
      • getName

        @NonNull
        public @NonNull java.lang.String getName()
      • equals

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object