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

javax.constraints.scheduler.ScheduleFactory Maven / Gradle / Ivy

The newest version!
package javax.constraints.scheduler;

import javax.constraints.Problem;
import javax.constraints.ProblemFactory;
import javax.constraints.scheduler.impl.ScheduleImpl;

public class ScheduleFactory {

	public static Schedule newSchedule(String name, int start, int end) {
		try {
			Problem problem = ProblemFactory.newProblem(name);
			Schedule schedule = new ScheduleImpl(problem, name, start, end);
			return schedule;
		} catch (Exception e) {
			throw new RuntimeException(
					"ScheduleFactory: Can not create an instance of the class ScheduleImpl",
					e);
		}
	}
	
	public static Schedule newSchedule(Problem problem) {
		try {
			Schedule schedule = new ScheduleImpl(problem, problem.getName());
			return schedule;
		} catch (Exception e) {
			throw new RuntimeException(
					"ScheduleFactory: Can not create an instance of the class ScheduleImpl",
					e);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy