
aima.core.search.csp.Variable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aima-core Show documentation
Show all versions of aima-core Show documentation
AIMA-Java Core Algorithms from the book Artificial Intelligence a Modern Approach 3rd Ed.
package aima.core.search.csp;
/**
* A variable is a distinguishable object with a name.
*
* @author Ruediger Lunde
*/
public class Variable {
private String name;
public Variable(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String toString() {
return name;
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (obj.getClass() == getClass())
return this.name.equals(((Variable) obj).name);
return false;
}
@Override
public int hashCode() {
return name.hashCode();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy