.class public Lcom/vv/hgtv/e;
.super Ljava/util/ArrayList;


# instance fields
.field private a:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 5

    invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V

    const-string v0, "favor.db"

    iput-object v0, p0, Lcom/vv/hgtv/e;->a:Ljava/lang/String;

    :try_start_0
    iget-object v0, p0, Lcom/vv/hgtv/e;->a:Ljava/lang/String;

    invoke-static {p1, v0}, Lcom/vv/hgtv/c;->a(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Lorg/json/JSONArray;

    invoke-direct {v1, v0}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    if-eqz v1, :cond_0

    const/4 v0, 0x0

    :goto_0
    invoke-virtual {v1}, Lorg/json/JSONArray;->length()I

    move-result v2

    if-lt v0, v2, :cond_1

    :cond_0
    :goto_1
    return-void

    :cond_1
    invoke-virtual {v1, v0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    const-string v3, "type"

    invoke-virtual {v2, v3}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v3

    const-string v4, "pos"

    invoke-virtual {v2, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v2

    new-instance v4, Lcom/vv/hgtv/f;

    invoke-direct {v4, v3, v2}, Lcom/vv/hgtv/f;-><init>(II)V

    invoke-virtual {p0, v4}, Lcom/vv/hgtv/e;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_1
.end method

.method private a()Ljava/lang/String;
    .locals 4

    const-string v1, "["

    const/4 v0, 0x0

    move v3, v0

    move-object v0, v1

    move v1, v3

    :goto_0
    invoke-virtual {p0}, Lcom/vv/hgtv/e;->size()I

    move-result v2

    if-lt v1, v2, :cond_0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

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

    const-string v0, "]"

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_0
    if-nez v1, :cond_1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vv/hgtv/f;

    invoke-virtual {v0}, Lcom/vv/hgtv/f;->a()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v0, ","

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vv/hgtv/f;

    invoke-virtual {v0}, Lcom/vv/hgtv/f;->a()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_1
.end method


# virtual methods
.method public a(I)V
    .locals 0

    invoke-virtual {p0, p1}, Lcom/vv/hgtv/e;->remove(I)Ljava/lang/Object;

    return-void
.end method

.method public a(Landroid/content/Context;)V
    .locals 2

    iget-object v0, p0, Lcom/vv/hgtv/e;->a:Ljava/lang/String;

    invoke-direct {p0}, Lcom/vv/hgtv/e;->a()Ljava/lang/String;

    move-result-object v1

    invoke-static {p1, v0, v1}, Lcom/vv/hgtv/c;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public a(II)Z
    .locals 3

    const/4 v2, 0x0

    move v1, v2

    :goto_0
    invoke-virtual {p0}, Lcom/vv/hgtv/e;->size()I

    move-result v0

    if-lt v1, v0, :cond_0

    :goto_1
    return v2

    :cond_0
    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vv/hgtv/f;

    iget v0, v0, Lcom/vv/hgtv/f;->a:I

    if-ne v0, p1, :cond_1

    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vv/hgtv/f;

    iget v0, v0, Lcom/vv/hgtv/f;->b:I

    if-ne v0, p2, :cond_1

    const/4 v2, 0x1

    goto :goto_1

    :cond_1
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0
.end method

.method public b(II)V
    .locals 2

    const/4 v0, 0x0

    move v1, v0

    :goto_0
    invoke-virtual {p0}, Lcom/vv/hgtv/e;->size()I

    move-result v0

    if-lt v1, v0, :cond_0

    :goto_1
    return-void

    :cond_0
    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vv/hgtv/f;

    iget v0, v0, Lcom/vv/hgtv/f;->a:I

    if-ne v0, p1, :cond_1

    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vv/hgtv/f;

    iget v0, v0, Lcom/vv/hgtv/f;->b:I

    if-ne v0, p2, :cond_1

    invoke-virtual {p0, v1}, Lcom/vv/hgtv/e;->remove(I)Ljava/lang/Object;

    goto :goto_1

    :cond_1
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0
.end method

.method public b(Landroid/content/Context;)V
    .locals 2

    iget-object v0, p0, Lcom/vv/hgtv/e;->a:Ljava/lang/String;

    const-string v1, "[]"

    invoke-static {p1, v0, v1}, Lcom/vv/hgtv/c;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method
