pl.gdela.socomo.composition.Component Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of socomo-core Show documentation
Show all versions of socomo-core Show documentation
Core parts of the tool for visualizing and analyzing source code modularity of a java project.
The newest version!
package pl.gdela.socomo.composition;
import java.util.Objects;
/**
* Slice of the code at give {@linkplain Level level}. Component is a child package under
* given level, together with all subpackages contained within it.
*/
public class Component implements Comparable {
public final String name;
public int size;
Component(String name) {
this.name = name;
}
void incrementSizeBy(int increment) {
size += increment;
}
@Override
public String toString() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Component that = (Component) o;
return Objects.equals(this.name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(this.name);
}
@Override
public int compareTo(Component that) {
return this.name.compareTo(that.name);
}
}