MCPcopy Create free account
hub / github.com/MenoData/Time4J / set

Method set

base/src/main/java/net/time4j/Duration.java:4264–4280  ·  view source on GitHub ↗
(
            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,

Callers 9

yearsMethod · 0.95
monthsMethod · 0.95
daysMethod · 0.95
hoursMethod · 0.95
minutesMethod · 0.95
secondsMethod · 0.95
plusMethod · 0.45
updateMethod · 0.45

Calls 5

ofMethod · 0.95
getMethod · 0.65
sizeMethod · 0.45
getUnitMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected