Commit 2b72204a authored by mey's avatar mey
Browse files

renamed ValuableAmountAdapter to AmountValuable.java

    moved to package sim.util
parent f0bc59ef
......@@ -6,7 +6,7 @@ import javax.measure.unit.Unit;
import org.jscience.physics.amount.Amount;
import de.zmt.util.AmountUtil;
import de.zmt.util.ValuableAmountAdapter;
import sim.util.AmountValuable;
import sim.util.Proxiable;
import sim.util.Valuable;
......@@ -258,15 +258,15 @@ public class ConfigurableStorage<Q extends Quantity> extends BaseStorage<Q> impl
public class MyPropertiesProxy {
public Valuable getAmount() {
return ValuableAmountAdapter.wrap(ConfigurableStorage.this.getAmount());
return AmountValuable.wrap(ConfigurableStorage.this.getAmount());
}
public Valuable getLowerLimit() {
return ValuableAmountAdapter.wrap(ConfigurableStorage.this.getLowerLimit());
return AmountValuable.wrap(ConfigurableStorage.this.getLowerLimit());
}
public Valuable getUpperLimit() {
return ValuableAmountAdapter.wrap(ConfigurableStorage.this.getUpperLimit());
return AmountValuable.wrap(ConfigurableStorage.this.getUpperLimit());
}
public double getFactorIn() {
......
package de.zmt.util;
package sim.util;
import org.jscience.physics.amount.Amount;
import sim.util.Valuable;
/**
* Simple adapter class wrapping around an {@link Amount} to be used as a
* {@link Valuable}.
*
* @author mey
*/
public class ValuableAmountAdapter implements Valuable {
public class AmountValuable implements Valuable {
private final Amount<?> amount;
private ValuableAmountAdapter(Amount<?> amount) {
private AmountValuable(Amount<?> amount) {
super();
this.amount = amount;
}
......@@ -29,15 +27,15 @@ public class ValuableAmountAdapter implements Valuable {
}
/**
* Returns {@code amount} wrapped into a {@link ValuableAmountAdapter} or
* Returns {@code amount} wrapped into a {@link Valuable} or
* <code>null</code> if {@code amount} is null.
*
* @param amount
* @return wrapped {@code amount}
*/
public static ValuableAmountAdapter wrap(Amount<?> amount) {
public static Valuable wrap(Amount<?> amount) {
if (amount != null) {
return new ValuableAmountAdapter(amount);
return new AmountValuable(amount);
}
return null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment