MCPcopy Create free account
hub / github.com/ReadyTalk/avian / scale

Method scale

classpath/java/util/concurrent/TimeUnit.java:364–373  ·  view source on GitHub ↗
(long value, long conversion)

Source from the content-addressed store, hash-verified

362 private static final long MINUETS_PER_DAY = MINUETS_PER_HOUR * HOURS_PER_DAY;
363
364 private static long scale(long value, long conversion) {
365 long result = value * conversion;
366 if (value > 0 && result < value) {
367 return Long.MAX_VALUE;
368 } else if (value < 0 && result > value) {
369 return Long.MIN_VALUE;
370 } else {
371 return result;
372 }
373 }
374
375 public abstract long convert(long sourceDuration, TimeUnit sourceUnit);
376

Callers 6

toNanosMethod · 0.95
toMicrosMethod · 0.95
toMillisMethod · 0.95
toSecondsMethod · 0.95
toMinutesMethod · 0.95
toHoursMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected