package hu.elte.txtuml.export.cpp.thread;

public class ThreadPoolConfiguration {

	public class LinearFunction {
		private double gradient;
		private int constant;

		LinearFunction(double gradient, int constant) {

			setGradient(gradient);
			setConstant(constant);
		}

		public double getGradient() {
			return gradient;
		}

		public int getConstant() {
			return constant;
		}

		public void setGradient(double gradient) {
			if (gradient >= 0 && gradient <= 1) {
				this.gradient = gradient;
			} else if (gradient < 0) {
				this.gradient = 0;
			} else if (gradient > 1) {
				this.gradient = 1;
			}

		}

		public void setConstant(int constant) {
			if (constant < 0) {
				this.constant = 0;
			} else {
				this.constant = constant;
			}
		}

	}

	public ThreadPoolConfiguration(int id, double gradient, int constant) {
		this.id = id;
		function = new LinearFunction(gradient, constant);

	}

	private LinearFunction function;

	private int id;
	private int threads;
	private int maxThread;

	public int getId() {
		return id;
	}

	public int getNumberOfThreads() {
		return threads;
	}

	public int getMaxThread() {
		return maxThread;
	}

	public LinearFunction getFunction() {
		return function;
	}

	public void setMaxThreads(int max) {
		if (max < 1) {
			maxThread = 1;
		} else {
			maxThread = max;
		}
	}
}

@@ -958,30 +958,8 @@
 id;%0A
-%09private int threads;%0A
 %09pri
@@ -1022,65 +1022,8 @@
 %09%7D%0A%0A
-%09public int getNumberOfThreads() %7B%0A%09%09return threads;%0A%09%7D%0A%0A
 %09pub

Create branch to export activities and remove a unnecessary field