Class ClassVertex

All Implemented Interfaces:
GraphVertex<ClassVertex>, Comparable<ClassVertex>

class ClassVertex extends AbstractVertex<InheritanceEdge,ClassVertex>
Vertex class - represents a class or interface in the InheritanceGraph. Edges connect subtypes to supertypes.
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractVertex<InheritanceEdge,ClassVertex>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractVertex<InheritanceEdge,ClassVertex>
    • createResolvedClassVertex

      public static ClassVertex createResolvedClassVertex(ClassDescriptor classDescriptor, XClass xclass)
      Factory method for resolved ClassVertex objects.
      Parameters:
      classDescriptor - ClassDescriptor naming the class or interface
      xclass - object containing information about a class or interface
      Returns:
      ClassVertex
    • createMissingClassVertex

      public static ClassVertex createMissingClassVertex(ClassDescriptor classDescriptor, boolean isInterface)
      Factory method for ClassVertex objects representing missing classes.
      Parameters:
      classDescriptor - ClassDescriptor naming the missing class or interface
      isInterface - true if missing class is an interface, false otherwise
      Returns:
      ClassVertex
    • getClassDescriptor

      public ClassDescriptor getClassDescriptor()
      Returns:
      Returns the classDescriptor.
    • getXClass

      @Nullable public XClass getXClass()
      Returns:
      Returns the xClass.
    • isResolved

      public boolean isResolved()
      Return true if this ClassVertex corresponds to a resolved class, or false if the class could not be found.
    • setFinished

      public void setFinished(boolean finished)
      Parameters:
      finished - The finished to set.
    • isFinished

      public boolean isFinished()
      Returns:
      Returns the finished.
    • markAsApplicationClass

      public void markAsApplicationClass()
      Mark this ClassVertex as representing an application class.
    • isApplicationClass

      public boolean isApplicationClass()
      Returns:
      true if this ClassVertex represents an application class, false otherwise
    • setInterface

      private void setInterface()
      Mark this ClassVertex as representing an interface.
    • isInterface

      public boolean isInterface()
      Returns:
      true if this ClassVertex represents an interface, false otherwise
    • setDirectSuperclass

      public void setDirectSuperclass(ClassVertex target)
      Set the ClassVertex representing the direct superclass.
      Parameters:
      target - ClassVertex representing the direct superclass.
    • getDirectSuperclass

      public ClassVertex getDirectSuperclass()
      Returns:
      Returns the directSuperclass.
    • setFlag

      private void setFlag(int flag, boolean enable)
    • isFlagSet

      private boolean isFlagSet(int flag)