(long factor)
| 796 | * @return changed copy of this duration |
| 797 | */ |
| 798 | public MachineTime<U> multipliedBy(long factor) { |
| 799 | |
| 800 | if (factor == 1) { |
| 801 | return this; |
| 802 | } else if (factor == 0) { |
| 803 | if (this.scale == POSIX) { |
| 804 | return cast(POSIX_ZERO); |
| 805 | } else { |
| 806 | return cast(UTC_ZERO); |
| 807 | } |
| 808 | } |
| 809 | |
| 810 | BigDecimal value = |
| 811 | this.toBigDecimal().multiply(BigDecimal.valueOf(factor)); |
| 812 | MachineTime<?> mt; |
| 813 | |
| 814 | if (this.scale == POSIX) { |
| 815 | mt = MachineTime.ofPosixSeconds(value); |
| 816 | } else { |
| 817 | mt = MachineTime.ofSISeconds(value); |
| 818 | } |
| 819 | |
| 820 | return cast(mt); |
| 821 | |
| 822 | } |
| 823 | |
| 824 | /** |
| 825 | * <p>Multiplies this duration with given decimal factor. </p> |
nothing calls this directly
no test coverage detected