26 lines
557 B
Java
26 lines
557 B
Java
package uebung05.logistics.material;
|
|
|
|
import uebung05.logistics.quantities.IntUnit;
|
|
|
|
public class ShellBatches implements IntUnit{
|
|
private static ShellBatches instance;
|
|
private int amount;
|
|
|
|
private ShellBatches(int amount){
|
|
this.amount = amount;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return amount + " batches of 120mm shells";
|
|
}
|
|
|
|
public static ShellBatches getInstance(int amount){
|
|
if (instance == null){
|
|
instance = new ShellBatches(amount);
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
}
|