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

javax.constraints.extra.VarList Maven / Gradle / Ivy

Go to download

JCP Standard JSR331 “Java Constraint Programming API”. It is used for Modeling and Solving Constraint Satisfaction and Optimization Problems using Java and off-the-shelf Constraint/Linear Solvers

The newest version!
package javax.constraints.extra;

import java.util.ArrayList;

import javax.constraints.Var;

public class VarList extends ArrayList { 
	
	public Var[] toArray() {
		Var[] array = new Var[size()];
		for (int i = 0; i < array.length; i++) {
			array[i] = get(i);
		}
		return array;
	}
	public void add(Var[] vars) {
		for (int i = 0; i < vars.length; i++) {
			Var var = vars[i];
			add(var);
		}
	} 

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy