import java.util.ArrayList;
import java.util.List;
+/**
+ * This class corresponds to single method within a java class.
+ */
public class MethodDescriptor implements GraphElement,
Comparable<MethodDescriptor> {
- /**
- * This class corresponds to single method within a java class.
- */
-
- public String methodName;
- public ClassDescriptor returnType;
+ private final String methodName;
+ private ClassDescriptor returnType;
private final ClassDescriptor parentClass;
-
- List<ClassDescriptor> argumentTypes = new ArrayList<ClassDescriptor>();
-
- boolean isInherited;
+ private final List<ClassDescriptor> argumentTypes = new ArrayList<ClassDescriptor>();
+ private boolean isInherited;
public MethodDescriptor(final ClassDescriptor parent,
final String methodName) {
public void analyze(final Method method) {
if (!method.getDeclaringClass().getName()
- .equals(parentClass.classFullyQualifiedName))
+ .equals(parentClass.getFullyQualifiedName()))
isInherited = true;
returnType = parentClass.getClassGraph().getOrCreateClassDescriptor(
return parentClass.getGraphId() + ":" + methodName;
}
- public String getMethodLabel() {
+ private String getMethodLabel() {
return methodName;
}
- public int getOutsideVisibleReferencesCount() {
+ protected int getOutsideVisibleReferencesCount() {
int result = 0;
if (returnType.isVisible())
final FieldDescriptor field = parentClass
.getFieldIgnoreCase(methodName.substring(2));
if (field != null)
- if ("boolean".equals(field.getType().classFullyQualifiedName))
+ if ("boolean".equals(field.getType().getFullyQualifiedName()))
return false;
}