/**
* Amount of field and method references pointing to this class.
*/
- private int incomingReferencesCount = 0;
+ private int referencesCount = 0;
+ // for interface, counts amount of found implementations
+ private int implementationsCount = 0;
+
+ // counts amount of times this class is extended
private int extensionsCount = 0;
public ClassDescriptor(final Class<? extends Object> clazz,
for (final Class interfaceClass : clazz.getInterfaces()) {
final ClassDescriptor classDescriptor = dump
.addClass(interfaceClass);
- classDescriptor.registerExtension();
+ classDescriptor.registerImplementation();
interfaces.add(classDescriptor);
}
}
public boolean areReferencesShown() {
- return incomingReferencesCount <= MAX_REFERECNES_COUNT;
+ return referencesCount <= MAX_REFERECNES_COUNT;
}
public void enlistFieldReferences(final StringBuffer result) {
return;
final int totalReferencesCount = getOutgoingReferencesCount()
- + incomingReferencesCount + extensionsCount;
+ + referencesCount + extensionsCount + implementationsCount;
if (totalReferencesCount == 0) {
hide();
}
/**
- * Register event when another class is extending this one, or is
- * implementing interface declared by this class.
+ * Register event when another class is extending this one.
*/
public void registerExtension() {
extensionsCount++;
}
+ public void registerImplementation() {
+ implementationsCount++;
+ }
+
public void registerReference() {
- incomingReferencesCount++;
+ referencesCount++;
}
public void setDistinctiveColor(final String distinctiveColor) {