/*
 * JaamSim Discrete Event Simulation
 * Copyright (C) 2013 Ausenco Engineering Canada Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
package com.jaamsim.Samples;

import com.jaamsim.units.Unit;

public class ConstantDouble implements SampleProvider {
	private final Class<? extends Unit> unitType;
	private final double val;

	public ConstantDouble(Class<? extends Unit> unitType, double val) {
		this.unitType = unitType;
		this.val = val;
	}

	@Override
	public Class<? extends Unit> getUnitType() {
		return unitType;
	}

	@Override
	public double getNextSample(double simTime) {
		return val;
	}
}

@@ -1061,11 +1061,187 @@
  val;%0A%09%7D
+%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09StringBuilder tmp = new StringBuilder();%0A%09%09tmp.append(val).append(%22  %22).append(Unit.getSIUnit(unitType));%0A%09%09return tmp.toString();%0A%09%7D
 %0A%7D%0A

add a toString() method to ConstantDouble so it appears correctly in the EditBox