package org.lucci.madhoc.simulation.measure;
public class Unit
{
private String name;
private String symbol;
public static final Unit EURO = new Unit("euro", "€");
public static final Unit METER = new Unit("meter", "m");
public static final Unit SECOND = new Unit("second", "s");
public static final Unit ITERATION = new Unit("iteration");
public static final Unit PERCENTAGE = new Unit("per cent", "%");
public static final Unit NUMBER_OF_STATIONS = new Unit("computer");
public static final Unit NUMBER_OF_PARTITION = new Unit("partition");
public static final Unit NUMBER_OF_CONNECTION = new Unit("connection");
public static final Unit NUMBER_OF_MESSAGE = new Unit("message");
public static final Unit BYTE = new Unit("byte", "b");
public static final Unit PENALITY_POINT = new Unit("penality point");
public static final Unit RATIO = new Unit("ratio [0, 1]");
public Unit(String name)
{
this(name, null);
}
public Unit(String name, String symbol)
{
if (name == null)
throw new IllegalArgumentException();
this.name = name;
this.symbol = symbol;
}
public String getName()
{
return name;
}
public String getSymbol()
{
return symbol;
}
public String getFormattedName()
{
if (symbol == null)
{
return name;
}
else
{
return name + " (" + symbol + ")";
}
}
}