118 lines
		
	
	
		
			8.1 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			118 lines
		
	
	
		
			8.1 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| package kotlin.time;
 | |
| 
 | |
| import androidx.constraintlayout.core.motion.utils.TypedValues;
 | |
| import kotlin.Deprecated;
 | |
| import kotlin.Metadata;
 | |
| import kotlin.jvm.internal.DefaultConstructorMarker;
 | |
| import kotlin.jvm.internal.Intrinsics;
 | |
| import kotlin.time.ComparableTimeMark;
 | |
| import kotlin.time.TimeSource;
 | |
| 
 | |
| /* compiled from: TimeSources.kt */
 | |
| @Deprecated(message = "Using AbstractDoubleTimeSource is no longer recommended, use AbstractLongTimeSource instead.")
 | |
| @Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0006\n\u0002\b\u0002\b'\u0018\u00002\u00020\u0001:\u0001\u000bB\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u0007\u001a\u00020\bH\u0016J\b\u0010\t\u001a\u00020\nH$R\u0014\u0010\u0002\u001a\u00020\u0003X\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006¨\u0006\f"}, d2 = {"Lkotlin/time/AbstractDoubleTimeSource;", "Lkotlin/time/TimeSource$WithComparableMarks;", "unit", "Lkotlin/time/DurationUnit;", "(Lkotlin/time/DurationUnit;)V", "getUnit", "()Lkotlin/time/DurationUnit;", "markNow", "Lkotlin/time/ComparableTimeMark;", "read", "", "DoubleTimeMark", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
 | |
| /* loaded from: classes.dex */
 | |
| public abstract class AbstractDoubleTimeSource implements TimeSource.WithComparableMarks {
 | |
|     private final DurationUnit unit;
 | |
| 
 | |
|     protected final DurationUnit getUnit() {
 | |
|         return this.unit;
 | |
|     }
 | |
| 
 | |
|     protected abstract double read();
 | |
| 
 | |
|     public AbstractDoubleTimeSource(DurationUnit unit) {
 | |
|         Intrinsics.checkNotNullParameter(unit, "unit");
 | |
|         this.unit = unit;
 | |
|     }
 | |
| 
 | |
|     /* compiled from: TimeSources.kt */
 | |
|     @Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0006\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B \u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007ø\u0001\u0000¢\u0006\u0002\u0010\bJ\u0015\u0010\n\u001a\u00020\u0007H\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b\u000b\u0010\fJ\u0013\u0010\r\u001a\u00020\u000e2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0096\u0002J\b\u0010\u0011\u001a\u00020\u0012H\u0016J\u001e\u0010\u0013\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u0001H\u0096\u0002ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b\u0014\u0010\u0015J\u001b\u0010\u0016\u001a\u00020\u00012\u0006\u0010\u0017\u001a\u00020\u0007H\u0096\u0002ø\u0001\u0000¢\u0006\u0004\b\u0018\u0010\u0019J\b\u0010\u001a\u001a\u00020\u001bH\u0016R\u0016\u0010\u0006\u001a\u00020\u0007X\u0082\u0004ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\n\u0002\u0010\tR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\b\n\u0002\b\u0019\n\u0002\b!¨\u0006\u001c"}, d2 = {"Lkotlin/time/AbstractDoubleTimeSource$DoubleTimeMark;", "Lkotlin/time/ComparableTimeMark;", "startedAt", "", "timeSource", "Lkotlin/time/AbstractDoubleTimeSource;", TypedValues.CycleType.S_WAVE_OFFSET, "Lkotlin/time/Duration;", "(DLkotlin/time/AbstractDoubleTimeSource;JLkotlin/jvm/internal/DefaultConstructorMarker;)V", "J", "elapsedNow", "elapsedNow-UwyO8pc", "()J", "equals", "", "other", "", "hashCode", "", "minus", "minus-UwyO8pc", "(Lkotlin/time/ComparableTimeMark;)J", "plus", TypedValues.TransitionType.S_DURATION, "plus-LRDsOJo", "(J)Lkotlin/time/ComparableTimeMark;", "toString", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
 | |
|     private static final class DoubleTimeMark implements ComparableTimeMark {
 | |
|         private final long offset;
 | |
|         private final double startedAt;
 | |
|         private final AbstractDoubleTimeSource timeSource;
 | |
| 
 | |
|         public /* synthetic */ DoubleTimeMark(double d, AbstractDoubleTimeSource abstractDoubleTimeSource, long j, DefaultConstructorMarker defaultConstructorMarker) {
 | |
|             this(d, abstractDoubleTimeSource, j);
 | |
|         }
 | |
| 
 | |
|         private DoubleTimeMark(double d, AbstractDoubleTimeSource timeSource, long j) {
 | |
|             Intrinsics.checkNotNullParameter(timeSource, "timeSource");
 | |
|             this.startedAt = d;
 | |
|             this.timeSource = timeSource;
 | |
|             this.offset = j;
 | |
|         }
 | |
| 
 | |
|         @Override // java.lang.Comparable
 | |
|         public int compareTo(ComparableTimeMark comparableTimeMark) {
 | |
|             return ComparableTimeMark.DefaultImpls.compareTo(this, comparableTimeMark);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.TimeMark
 | |
|         public boolean hasNotPassedNow() {
 | |
|             return ComparableTimeMark.DefaultImpls.hasNotPassedNow(this);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.TimeMark
 | |
|         public boolean hasPassedNow() {
 | |
|             return ComparableTimeMark.DefaultImpls.hasPassedNow(this);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.TimeMark
 | |
|         /* renamed from: minus-LRDsOJo, reason: not valid java name */
 | |
|         public ComparableTimeMark mo1665minusLRDsOJo(long j) {
 | |
|             return ComparableTimeMark.DefaultImpls.m1670minusLRDsOJo(this, j);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.TimeMark
 | |
|         /* renamed from: elapsedNow-UwyO8pc, reason: not valid java name */
 | |
|         public long mo1664elapsedNowUwyO8pc() {
 | |
|             return Duration.m1710minusLRDsOJo(DurationKt.toDuration(this.timeSource.read() - this.startedAt, this.timeSource.getUnit()), this.offset);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.TimeMark
 | |
|         /* renamed from: plus-LRDsOJo, reason: not valid java name */
 | |
|         public ComparableTimeMark mo1667plusLRDsOJo(long duration) {
 | |
|             return new DoubleTimeMark(this.startedAt, this.timeSource, Duration.m1711plusLRDsOJo(this.offset, duration), null);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.ComparableTimeMark
 | |
|         /* renamed from: minus-UwyO8pc, reason: not valid java name */
 | |
|         public long mo1666minusUwyO8pc(ComparableTimeMark other) {
 | |
|             Intrinsics.checkNotNullParameter(other, "other");
 | |
|             if (other instanceof DoubleTimeMark) {
 | |
|                 DoubleTimeMark doubleTimeMark = (DoubleTimeMark) other;
 | |
|                 if (Intrinsics.areEqual(this.timeSource, doubleTimeMark.timeSource)) {
 | |
|                     if (Duration.m1680equalsimpl0(this.offset, doubleTimeMark.offset) && Duration.m1707isInfiniteimpl(this.offset)) {
 | |
|                         return Duration.INSTANCE.m1777getZEROUwyO8pc();
 | |
|                     }
 | |
|                     long m1710minusLRDsOJo = Duration.m1710minusLRDsOJo(this.offset, doubleTimeMark.offset);
 | |
|                     long duration = DurationKt.toDuration(this.startedAt - doubleTimeMark.startedAt, this.timeSource.getUnit());
 | |
|                     return Duration.m1680equalsimpl0(duration, Duration.m1727unaryMinusUwyO8pc(m1710minusLRDsOJo)) ? Duration.INSTANCE.m1777getZEROUwyO8pc() : Duration.m1711plusLRDsOJo(duration, m1710minusLRDsOJo);
 | |
|                 }
 | |
|             }
 | |
|             throw new IllegalArgumentException("Subtracting or comparing time marks from different time sources is not possible: " + this + " and " + other);
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.ComparableTimeMark
 | |
|         public boolean equals(Object other) {
 | |
|             return (other instanceof DoubleTimeMark) && Intrinsics.areEqual(this.timeSource, ((DoubleTimeMark) other).timeSource) && Duration.m1680equalsimpl0(mo1666minusUwyO8pc((ComparableTimeMark) other), Duration.INSTANCE.m1777getZEROUwyO8pc());
 | |
|         }
 | |
| 
 | |
|         @Override // kotlin.time.ComparableTimeMark
 | |
|         public int hashCode() {
 | |
|             return Duration.m1703hashCodeimpl(Duration.m1711plusLRDsOJo(DurationKt.toDuration(this.startedAt, this.timeSource.getUnit()), this.offset));
 | |
|         }
 | |
| 
 | |
|         public String toString() {
 | |
|             return "DoubleTimeMark(" + this.startedAt + DurationUnitKt.shortName(this.timeSource.getUnit()) + " + " + ((Object) Duration.m1724toStringimpl(this.offset)) + ", " + this.timeSource + ')';
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     @Override // kotlin.time.TimeSource
 | |
|     public ComparableTimeMark markNow() {
 | |
|         return new DoubleTimeMark(read(), this, Duration.INSTANCE.m1777getZEROUwyO8pc(), null);
 | |
|     }
 | |
| }
 |