.class public Lcom/badlogic/gdx/utils/Array$ArrayIterator;
.super Ljava/lang/Object;
.source "Array.java"

# interfaces
.implements Ljava/lang/Iterable;
.implements Ljava/util/Iterator;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/badlogic/gdx/utils/Array;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "ArrayIterator"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;",
        "Ljava/lang/Iterable<",
        "TT;>;",
        "Ljava/util/Iterator<",
        "TT;>;"
    }
.end annotation


# instance fields
.field a:I

.field b:Z

.field private final c:Lcom/badlogic/gdx/utils/Array;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/badlogic/gdx/utils/Array<",
            "TT;>;"
        }
    .end annotation
.end field

.field private final d:Z


# direct methods
.method public constructor <init>(Lcom/badlogic/gdx/utils/Array;Z)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/badlogic/gdx/utils/Array<",
            "TT;>;Z)V"
        }
    .end annotation

    .line 542
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x1

    .line 534
    iput-boolean v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->b:Z

    .line 543
    iput-object p1, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->c:Lcom/badlogic/gdx/utils/Array;

    .line 544
    iput-boolean p2, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->d:Z

    return-void
.end method


# virtual methods
.method public hasNext()Z
    .locals 2

    .line 548
    iget-boolean v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->b:Z

    if-eqz v0, :cond_1

    .line 552
    iget v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    iget-object v1, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->c:Lcom/badlogic/gdx/utils/Array;

    iget v1, v1, Lcom/badlogic/gdx/utils/Array;->b:I

    if-ge v0, v1, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0

    .line 550
    :cond_1
    new-instance v0, Lcom/badlogic/gdx/utils/GdxRuntimeException;

    const-string v1, "#iterator() cannot be used nested."

    invoke-direct {v0, v1}, Lcom/badlogic/gdx/utils/GdxRuntimeException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public iterator()Ljava/util/Iterator;
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Iterator<",
            "TT;>;"
        }
    .end annotation

    return-object p0
.end method

.method public next()Ljava/lang/Object;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TT;"
        }
    .end annotation

    .line 556
    iget v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    iget-object v1, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->c:Lcom/badlogic/gdx/utils/Array;

    iget v1, v1, Lcom/badlogic/gdx/utils/Array;->b:I

    if-ge v0, v1, :cond_1

    .line 557
    iget-boolean v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->b:Z

    if-eqz v0, :cond_0

    .line 561
    iget-object v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->c:Lcom/badlogic/gdx/utils/Array;

    iget-object v0, v0, Lcom/badlogic/gdx/utils/Array;->a:[Ljava/lang/Object;

    iget v1, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    add-int/lit8 v2, v1, 0x1

    iput v2, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    aget-object v0, v0, v1

    return-object v0

    .line 559
    :cond_0
    new-instance v0, Lcom/badlogic/gdx/utils/GdxRuntimeException;

    const-string v1, "#iterator() cannot be used nested."

    invoke-direct {v0, v1}, Lcom/badlogic/gdx/utils/GdxRuntimeException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 556
    :cond_1
    new-instance v0, Ljava/util/NoSuchElementException;

    iget v1, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/util/NoSuchElementException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public remove()V
    .locals 2

    .line 565
    iget-boolean v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->d:Z

    if-eqz v0, :cond_0

    .line 566
    iget v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    add-int/lit8 v0, v0, -0x1

    iput v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    .line 567
    iget-object v0, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->c:Lcom/badlogic/gdx/utils/Array;

    iget v1, p0, Lcom/badlogic/gdx/utils/Array$ArrayIterator;->a:I

    invoke-virtual {v0, v1}, Lcom/badlogic/gdx/utils/Array;->b(I)Ljava/lang/Object;

    return-void

    .line 565
    :cond_0
    new-instance v0, Lcom/badlogic/gdx/utils/GdxRuntimeException;

    const-string v1, "Remove not allowed."

    invoke-direct {v0, v1}, Lcom/badlogic/gdx/utils/GdxRuntimeException;-><init>(Ljava/lang/String;)V

    throw v0
.end method
