Method
set
(
long amount,
IsoUnit unit
)
Source from the content-addressed store, hash-verified
| 4262 | } |
| 4263 | |
| 4264 | private void set( |
| 4265 | long amount, |
| 4266 | IsoUnit unit |
| 4267 | ) { |
| 4268 | |
| 4269 | for (int i = 0, n = this.items.size(); i < n; i++) { |
| 4270 | if (this.items.get(i).getUnit() == unit) { |
| 4271 | throw new IllegalStateException("Already registered: " + unit); |
| 4272 | } |
| 4273 | } |
| 4274 | |
| 4275 | if (amount != 0) { |
| 4276 | Item<IsoUnit> item = Item.of(amount, unit); |
| 4277 | this.items.add(item); |
| 4278 | } |
| 4279 | |
| 4280 | } |
| 4281 | |
| 4282 | private void update( |
| 4283 | long amount, |
Tested by
no test coverage detected