Package edu.umd.cs.findbugs.ba.ch
Class ClassVertex
java.lang.Object
edu.umd.cs.findbugs.graph.AbstractVertex<InheritanceEdge,ClassVertex>
edu.umd.cs.findbugs.ba.ch.ClassVertex
- All Implemented Interfaces:
GraphVertex<ClassVertex>
,Comparable<ClassVertex>
Vertex class - represents a class or interface in the InheritanceGraph. Edges
connect subtypes to supertypes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final ClassDescriptor
private ClassVertex
private static final int
private int
private static final int
private final XClass
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ClassVertex
(ClassDescriptor classDescriptor, boolean isInterfaceEdge) private
ClassVertex
(ClassDescriptor classDescriptor, XClass xclass) -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassVertex
createMissingClassVertex
(ClassDescriptor classDescriptor, boolean isInterface) Factory method for ClassVertex objects representing missing classes.static ClassVertex
createResolvedClassVertex
(ClassDescriptor classDescriptor, XClass xclass) Factory method for resolved ClassVertex objects.boolean
int
hashCode()
boolean
boolean
private boolean
isFlagSet
(int flag) boolean
boolean
Return true if this ClassVertex corresponds to a resolved class, or false if the class could not be found.void
Mark this ClassVertex as representing an application class.void
setDirectSuperclass
(ClassVertex target) Set the ClassVertex representing the direct superclass.void
setFinished
(boolean finished) private void
setFlag
(int flag, boolean enable) private void
Mark this ClassVertex as representing an interface.toString()
Methods inherited from class edu.umd.cs.findbugs.graph.AbstractVertex
compareTo, getLabel, setLabel
-
Field Details
-
FINISHED
private static final int FINISHED- See Also:
-
APPLICATION_CLASS
private static final int APPLICATION_CLASS- See Also:
-
INTERFACE
private static final int INTERFACE- See Also:
-
classDescriptor
-
xclass
-
flags
private int flags -
directSuperclass
-
-
Constructor Details
-
ClassVertex
-
ClassVertex
-
-
Method Details
-
toString
-
equals
- Overrides:
equals
in classAbstractVertex<InheritanceEdge,
ClassVertex>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractVertex<InheritanceEdge,
ClassVertex>
-
createResolvedClassVertex
Factory method for resolved ClassVertex objects.- Parameters:
classDescriptor
- ClassDescriptor naming the class or interfacexclass
- 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 interfaceisInterface
- true if missing class is an interface, false otherwise- Returns:
- ClassVertex
-
getClassDescriptor
- Returns:
- Returns the classDescriptor.
-
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
Set the ClassVertex representing the direct superclass.- Parameters:
target
- ClassVertex representing the direct superclass.
-
getDirectSuperclass
- Returns:
- Returns the directSuperclass.
-
setFlag
private void setFlag(int flag, boolean enable) -
isFlagSet
private boolean isFlagSet(int flag)
-