You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
460 lines
11 KiB
460 lines
11 KiB
.class final Lcom/google/common/math/MathPreconditions; |
|
.super Ljava/lang/Object; |
|
.source "MathPreconditions.java" |
|
|
|
|
|
# annotations |
|
.annotation build Lcom/google/common/annotations/GwtCompatible; |
|
.end annotation |
|
|
|
|
|
# direct methods |
|
.method private constructor <init>()V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 97 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
return-void |
|
.end method |
|
|
|
.method static checkInRange(Z)V |
|
.locals 2 |
|
|
|
.prologue |
|
.line 86 |
|
if-nez p0, :cond_0 |
|
|
|
.line 87 |
|
new-instance v0, Ljava/lang/ArithmeticException; |
|
|
|
const-string v1, "not in range" |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/ArithmeticException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 89 |
|
:cond_0 |
|
return-void |
|
.end method |
|
|
|
.method static checkNoOverflow(Z)V |
|
.locals 2 |
|
|
|
.prologue |
|
.line 92 |
|
if-nez p0, :cond_0 |
|
|
|
.line 93 |
|
new-instance v0, Ljava/lang/ArithmeticException; |
|
|
|
const-string v1, "overflow" |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/ArithmeticException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 95 |
|
:cond_0 |
|
return-void |
|
.end method |
|
|
|
.method static checkNonNegative(Ljava/lang/String;D)D |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 73 |
|
const-wide/16 v0, 0x0 |
|
|
|
cmpl-double v0, p1, v0 |
|
|
|
if-gez v0, :cond_0 |
|
|
|
.line 74 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be >= 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 76 |
|
:cond_0 |
|
return-wide p1 |
|
.end method |
|
|
|
.method static checkNonNegative(Ljava/lang/String;I)I |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 52 |
|
if-gez p1, :cond_0 |
|
|
|
.line 53 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be >= 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 55 |
|
:cond_0 |
|
return p1 |
|
.end method |
|
|
|
.method static checkNonNegative(Ljava/lang/String;J)J |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 59 |
|
const-wide/16 v0, 0x0 |
|
|
|
cmp-long v0, p1, v0 |
|
|
|
if-gez v0, :cond_0 |
|
|
|
.line 60 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be >= 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 62 |
|
:cond_0 |
|
return-wide p1 |
|
.end method |
|
|
|
.method static checkNonNegative(Ljava/lang/String;Ljava/math/BigInteger;)Ljava/math/BigInteger; |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 66 |
|
invoke-virtual {p1}, Ljava/math/BigInteger;->signum()I |
|
|
|
move-result v0 |
|
|
|
if-gez v0, :cond_0 |
|
|
|
.line 67 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be >= 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 69 |
|
:cond_0 |
|
return-object p1 |
|
.end method |
|
|
|
.method static checkPositive(Ljava/lang/String;I)I |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 31 |
|
if-gtz p1, :cond_0 |
|
|
|
.line 32 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be > 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 34 |
|
:cond_0 |
|
return p1 |
|
.end method |
|
|
|
.method static checkPositive(Ljava/lang/String;J)J |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 38 |
|
const-wide/16 v0, 0x0 |
|
|
|
cmp-long v0, p1, v0 |
|
|
|
if-gtz v0, :cond_0 |
|
|
|
.line 39 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be > 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 41 |
|
:cond_0 |
|
return-wide p1 |
|
.end method |
|
|
|
.method static checkPositive(Ljava/lang/String;Ljava/math/BigInteger;)Ljava/math/BigInteger; |
|
.locals 3 |
|
.param p0 # Ljava/lang/String; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
.line 45 |
|
invoke-virtual {p1}, Ljava/math/BigInteger;->signum()I |
|
|
|
move-result v0 |
|
|
|
if-gtz v0, :cond_0 |
|
|
|
.line 46 |
|
new-instance v0, Ljava/lang/IllegalArgumentException; |
|
|
|
new-instance v1, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, " (" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
const-string v2, ") must be > 0" |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v1 |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 48 |
|
:cond_0 |
|
return-object p1 |
|
.end method |
|
|
|
.method static checkRoundingUnnecessary(Z)V |
|
.locals 2 |
|
|
|
.prologue |
|
.line 80 |
|
if-nez p0, :cond_0 |
|
|
|
.line 81 |
|
new-instance v0, Ljava/lang/ArithmeticException; |
|
|
|
const-string v1, "mode was UNNECESSARY, but rounding was necessary" |
|
|
|
invoke-direct {v0, v1}, Ljava/lang/ArithmeticException;-><init>(Ljava/lang/String;)V |
|
|
|
throw v0 |
|
|
|
.line 83 |
|
:cond_0 |
|
return-void |
|
.end method
|
|
|