ai.libs.mlplan.multiclasswithreduction.ClassSplit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mlplan-ext-reduction Show documentation
Show all versions of mlplan-ext-reduction Show documentation
This project provides an implementation of the AutoML tool ML-Plan.
package ai.libs.mlplan.multiclasswithreduction;
import java.util.ArrayList;
import java.util.Collection;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
public class ClassSplit {
private final Collection classes;
private final Collection l;
private final Collection r;
public ClassSplit(final Collection classes, final Collection l, final Collection r) {
super();
this.classes = classes;
this.l = l;
this.r = r;
}
public ClassSplit(final ClassSplit split) {
this(split.getClasses(), new ArrayList<>(split.getL()), new ArrayList<>(split.getR()));
}
public Collection getClasses() {
return this.classes;
}
public Collection getL() {
return this.l;
}
public Collection getR() {
return this.r;
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(this.classes).append(this.l).append(this.r).toHashCode();
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ClassSplit)) {
return false;
}
ClassSplit> other = (ClassSplit>) obj;
return new EqualsBuilder().append(other.classes, this.classes).append(other.l, this.l).append(other.r, this.r).isEquals();
}
@Override
public String toString() {
return "ClassSplit [classes=" + this.classes + ", l=" + this.l + ", r=" + this.r + "]";
}
}