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.
300 lines
6.6 KiB
300 lines
6.6 KiB
.class public final Lcom/google/common/collect/EvictingQueue; |
|
.super Lcom/google/common/collect/ForwardingQueue; |
|
.source "EvictingQueue.java" |
|
|
|
# interfaces |
|
.implements Ljava/io/Serializable; |
|
|
|
|
|
# annotations |
|
.annotation build Lcom/google/common/annotations/Beta; |
|
.end annotation |
|
|
|
.annotation build Lcom/google/common/annotations/GwtIncompatible; |
|
value = "java.util.ArrayDeque" |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"<E:", |
|
"Ljava/lang/Object;", |
|
">", |
|
"Lcom/google/common/collect/ForwardingQueue", |
|
"<TE;>;", |
|
"Ljava/io/Serializable;" |
|
} |
|
.end annotation |
|
|
|
|
|
# static fields |
|
.field private static final serialVersionUID:J |
|
|
|
|
|
# instance fields |
|
.field private final delegate:Ljava/util/Queue; |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"Ljava/util/Queue", |
|
"<TE;>;" |
|
} |
|
.end annotation |
|
.end field |
|
|
|
.field final maxSize:I |
|
.annotation build Lcom/google/common/annotations/VisibleForTesting; |
|
.end annotation |
|
.end field |
|
|
|
|
|
# direct methods |
|
.method private constructor <init>(I)V |
|
.locals 5 |
|
|
|
.prologue |
|
const/4 v1, 0x1 |
|
|
|
const/4 v2, 0x0 |
|
|
|
.line 53 |
|
invoke-direct {p0}, Lcom/google/common/collect/ForwardingQueue;-><init>()V |
|
|
|
.line 54 |
|
if-ltz p1, :cond_0 |
|
|
|
move v0, v1 |
|
|
|
:goto_0 |
|
const-string v3, "maxSize (%s) must >= 0" |
|
|
|
new-array v1, v1, [Ljava/lang/Object; |
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; |
|
|
|
move-result-object v4 |
|
|
|
aput-object v4, v1, v2 |
|
|
|
invoke-static {v0, v3, v1}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;[Ljava/lang/Object;)V |
|
|
|
.line 55 |
|
new-instance v0, Ljava/util/LinkedList; |
|
|
|
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V |
|
|
|
iput-object v0, p0, Lcom/google/common/collect/EvictingQueue;->delegate:Ljava/util/Queue; |
|
|
|
.line 56 |
|
iput p1, p0, Lcom/google/common/collect/EvictingQueue;->maxSize:I |
|
|
|
.line 57 |
|
return-void |
|
|
|
:cond_0 |
|
move v0, v2 |
|
|
|
.line 54 |
|
goto :goto_0 |
|
.end method |
|
|
|
.method public static create(I)Lcom/google/common/collect/EvictingQueue; |
|
.locals 1 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"<E:", |
|
"Ljava/lang/Object;", |
|
">(I)", |
|
"Lcom/google/common/collect/EvictingQueue", |
|
"<TE;>;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 66 |
|
new-instance v0, Lcom/google/common/collect/EvictingQueue; |
|
|
|
invoke-direct {v0, p0}, Lcom/google/common/collect/EvictingQueue;-><init>(I)V |
|
|
|
return-object v0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public add(Ljava/lang/Object;)Z |
|
.locals 3 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(TE;)Z" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
const/4 v2, 0x1 |
|
|
|
.line 100 |
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
.line 101 |
|
iget v0, p0, Lcom/google/common/collect/EvictingQueue;->maxSize:I |
|
|
|
if-nez v0, :cond_0 |
|
|
|
.line 108 |
|
:goto_0 |
|
return v2 |
|
|
|
.line 104 |
|
:cond_0 |
|
invoke-virtual {p0}, Lcom/google/common/collect/EvictingQueue;->size()I |
|
|
|
move-result v0 |
|
|
|
iget v1, p0, Lcom/google/common/collect/EvictingQueue;->maxSize:I |
|
|
|
if-ne v0, v1, :cond_1 |
|
|
|
.line 105 |
|
iget-object v0, p0, Lcom/google/common/collect/EvictingQueue;->delegate:Ljava/util/Queue; |
|
|
|
invoke-interface {v0}, Ljava/util/Queue;->remove()Ljava/lang/Object; |
|
|
|
.line 107 |
|
:cond_1 |
|
iget-object v0, p0, Lcom/google/common/collect/EvictingQueue;->delegate:Ljava/util/Queue; |
|
|
|
invoke-interface {v0, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public addAll(Ljava/util/Collection;)Z |
|
.locals 1 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(", |
|
"Ljava/util/Collection", |
|
"<+TE;>;)Z" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 112 |
|
invoke-virtual {p0, p1}, Lcom/google/common/collect/EvictingQueue;->standardAddAll(Ljava/util/Collection;)Z |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public contains(Ljava/lang/Object;)Z |
|
.locals 2 |
|
|
|
.prologue |
|
.line 117 |
|
invoke-virtual {p0}, Lcom/google/common/collect/EvictingQueue;->delegate()Ljava/util/Queue; |
|
|
|
move-result-object v0 |
|
|
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v1 |
|
|
|
invoke-interface {v0, v1}, Ljava/util/Queue;->contains(Ljava/lang/Object;)Z |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
.end method |
|
|
|
.method protected bridge synthetic delegate()Ljava/lang/Object; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 44 |
|
invoke-virtual {p0}, Lcom/google/common/collect/EvictingQueue;->delegate()Ljava/util/Queue; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method protected bridge synthetic delegate()Ljava/util/Collection; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 44 |
|
invoke-virtual {p0}, Lcom/google/common/collect/EvictingQueue;->delegate()Ljava/util/Queue; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method protected delegate()Ljava/util/Queue; |
|
.locals 1 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"()", |
|
"Ljava/util/Queue", |
|
"<TE;>;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 80 |
|
iget-object v0, p0, Lcom/google/common/collect/EvictingQueue;->delegate:Ljava/util/Queue; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public offer(Ljava/lang/Object;)Z |
|
.locals 1 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(TE;)Z" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 90 |
|
invoke-virtual {p0, p1}, Lcom/google/common/collect/EvictingQueue;->add(Ljava/lang/Object;)Z |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public remainingCapacity()I |
|
.locals 2 |
|
|
|
.prologue |
|
.line 76 |
|
iget v0, p0, Lcom/google/common/collect/EvictingQueue;->maxSize:I |
|
|
|
invoke-virtual {p0}, Lcom/google/common/collect/EvictingQueue;->size()I |
|
|
|
move-result v1 |
|
|
|
sub-int/2addr v0, v1 |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public remove(Ljava/lang/Object;)Z |
|
.locals 2 |
|
|
|
.prologue |
|
.line 122 |
|
invoke-virtual {p0}, Lcom/google/common/collect/EvictingQueue;->delegate()Ljava/util/Queue; |
|
|
|
move-result-object v0 |
|
|
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
move-result-object v1 |
|
|
|
invoke-interface {v0, v1}, Ljava/util/Queue;->remove(Ljava/lang/Object;)Z |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
.end method
|
|
|