-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathClassInfo.java
More file actions
73 lines (59 loc) · 1.78 KB
/
Copy pathClassInfo.java
File metadata and controls
73 lines (59 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package org.example.model;
import java.util.ArrayList;
import java.util.List;
public class ClassInfo {
private final String name;
private final String superName;
private final List<MethodInfo> methods;
private int fieldCount;
private int inheritanceDepth;
private int overriddenMethodsCount;
public ClassInfo(String name, String superName) {
this.name = name;
this.superName = superName;
this.methods = new ArrayList<>();
this.fieldCount = 0;
this.inheritanceDepth = -1;
this.overriddenMethodsCount = 0;
}
public String getName() {
return name;
}
public String getSuperName() {
return superName;
}
public List<MethodInfo> getMethods() {
return methods;
}
public void addMethod(MethodInfo method) {
this.methods.add(method);
}
public int getFieldCount() {
return fieldCount;
}
public void setFieldCount(int fieldCount) {
this.fieldCount = fieldCount;
}
public int getInheritanceDepth() {
return inheritanceDepth;
}
public void setInheritanceDepth(int inheritanceDepth) {
this.inheritanceDepth = inheritanceDepth;
}
public int getOverriddenMethodsCount() {
return overriddenMethodsCount;
}
public void setOverriddenMethodsCount(int overriddenMethodsCount) {
this.overriddenMethodsCount = overriddenMethodsCount;
}
@Override
public String toString() {
return "ClassInfo{" +
"name='" + name + '\'' +
", superName='" + superName + '\'' +
", methods=" + methods.size() +
", fieldCount=" + fieldCount +
", inheritanceDepth=" + inheritanceDepth +
'}';
}
}