All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.libs.mlplan.multiclasswithreduction.ClassSplit Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
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 + "]";
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy