47 lines
896 B
Java
47 lines
896 B
Java
package afryca.consensusmodel.variable;
|
|
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
import afryca.consensusmodel.variable.restriction.Restriction;
|
|
|
|
/**
|
|
* Variable's restrictions
|
|
*
|
|
* @author Sinbad²
|
|
* @version 3.0
|
|
*/
|
|
public class Restrictions {
|
|
|
|
private Set<Restriction> restrictions = new HashSet<>();
|
|
|
|
/**
|
|
* Add variable's restriction
|
|
*
|
|
* @param restriction
|
|
* Restriction
|
|
*/
|
|
public void addRestriction(Restriction restriction) {
|
|
restrictions.add(restriction);
|
|
}
|
|
|
|
/**
|
|
* Set all variable's restrictions
|
|
*
|
|
* @param relations
|
|
* Set of variable's restrictions
|
|
*/
|
|
public void setRestrictions(Set<Restriction> restrictions) {
|
|
this.restrictions = restrictions;
|
|
}
|
|
|
|
/**
|
|
* Get all variable's restrictions
|
|
*
|
|
* @return Set of all variable's restrictions
|
|
*/
|
|
public Set<Restriction> getRestrictions() {
|
|
return restrictions;
|
|
}
|
|
}
|