
pl.gdela.socomo.composition.ComponentDep 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 single java project.
package pl.gdela.socomo.composition;
import org.apache.commons.lang3.builder.CompareToBuilder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class ComponentDep implements Comparable {
public final Component from;
public final Component to;
public int strength;
ComponentDep(Component from, Component to) {
this.from = from;
this.to = to;
}
void incrementStrengthBy(int increment) {
strength += increment;
}
@Override
public String toString() {
return from + " -> " + to;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ComponentDep that = (ComponentDep) o;
return new EqualsBuilder()
.append(from, that.from)
.append(to, that.to)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 9)
.append(from)
.append(to)
.toHashCode();
}
@Override
public int compareTo(ComponentDep that) {
return new CompareToBuilder()
.append(from, that.from)
.append(to, that.to)
.toComparison();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy