.class public Lcom/in2wow/sdk/p;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lcom/intowow/sdk/StreamHelper$IStreamPositionManager;


# instance fields
.field private a:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/Boolean;",
            ">;"
        }
    .end annotation
.end field

.field private b:I

.field private c:I

.field private d:I

.field private e:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private f:I

.field private g:I


# direct methods
.method public constructor <init>()V
    .locals 2

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

    .line 13
    new-instance v0, Ljava/util/HashMap;

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

    iput-object v0, p0, Lcom/in2wow/sdk/p;->a:Ljava/util/Map;

    const/4 v0, 0x1

    .line 14
    iput v0, p0, Lcom/in2wow/sdk/p;->b:I

    const/16 v0, 0x3e7

    .line 15
    iput v0, p0, Lcom/in2wow/sdk/p;->c:I

    const/4 v0, -0x1

    .line 16
    iput v0, p0, Lcom/in2wow/sdk/p;->d:I

    .line 17
    new-instance v1, Ljava/util/HashMap;

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

    iput-object v1, p0, Lcom/in2wow/sdk/p;->e:Ljava/util/Map;

    .line 18
    iput v0, p0, Lcom/in2wow/sdk/p;->f:I

    .line 19
    iput v0, p0, Lcom/in2wow/sdk/p;->g:I

    return-void
.end method


# virtual methods
.method public getAdPlace()I
    .locals 1

    .line 123
    iget v0, p0, Lcom/in2wow/sdk/p;->b:I

    return v0
.end method

.method public getFirstVisiblePosition()I
    .locals 1

    .line 172
    iget v0, p0, Lcom/in2wow/sdk/p;->g:I

    return v0
.end method

.method public getLastAddedPosition(Ljava/lang/String;)I
    .locals 1

    if-eqz p1, :cond_1

    .line 164
    iget-object v0, p0, Lcom/in2wow/sdk/p;->e:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    goto :goto_0

    .line 167
    :cond_0
    iget-object v0, p0, Lcom/in2wow/sdk/p;->e:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/Integer;

    invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I

    move-result p1

    return p1

    :cond_1
    :goto_0
    const/4 p1, -0x1

    return p1
.end method

.method public getLastVisiblePosition()I
    .locals 1

    .line 177
    iget v0, p0, Lcom/in2wow/sdk/p;->f:I

    return v0
.end method

.method public getStreamMaximumServingPosition()I
    .locals 1

    .line 187
    iget v0, p0, Lcom/in2wow/sdk/p;->d:I

    return v0
.end method

.method public getStreamMinimumServingPosition()I
    .locals 1

    .line 182
    iget v0, p0, Lcom/in2wow/sdk/p;->c:I

    return v0
.end method

.method public getTargetIndex(Lcom/intowow/sdk/RequestInfo;)I
    .locals 4

    const/4 v0, -0x1

    if-eqz p1, :cond_4

    .line 26
    invoke-virtual {p1}, Lcom/intowow/sdk/RequestInfo;->getRulePositionRanges()Ljava/util/Set;

    move-result-object v1

    if-eqz v1, :cond_4

    invoke-virtual {p1}, Lcom/intowow/sdk/RequestInfo;->getRulePositionSet()Ljava/util/Set;

    move-result-object v1

    if-eqz v1, :cond_4

    .line 28
    invoke-virtual {p1}, Lcom/intowow/sdk/RequestInfo;->getPlacement()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/in2wow/sdk/p;->getLastAddedPosition(Ljava/lang/String;)I

    move-result v1

    .line 30
    invoke-virtual {p1}, Lcom/intowow/sdk/RequestInfo;->isBlocking()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 36
    invoke-virtual {p1}, Lcom/intowow/sdk/RequestInfo;->getRequestPositionIndex()I

    move-result v0

    goto :goto_1

    .line 44
    :cond_0
    iget v2, p0, Lcom/in2wow/sdk/p;->f:I

    if-ne v2, v0, :cond_1

    return v0

    .line 50
    :cond_1
    iget v2, p0, Lcom/in2wow/sdk/p;->f:I

    add-int/lit8 v2, v2, 0x1

    .line 51
    invoke-virtual {p1}, Lcom/intowow/sdk/RequestInfo;->getPlacementServingFrequency()I

    move-result v3

    add-int/2addr v3, v1

    add-int/lit8 v3, v3, 0x1

    if-eq v1, v0, :cond_2

    .line 60
    invoke-static {v2, v3}, Ljava/lang/Math;->max(II)I

    move-result v1

    goto :goto_0

    :cond_2
    move v1, v2

    .line 71
    :goto_0
    invoke-virtual {p1, v1}, Lcom/intowow/sdk/RequestInfo;->isInRange(I)Z

    move-result p1

    if-nez p1, :cond_3

    goto :goto_1

    :cond_3
    move v0, v1

    :cond_4
    :goto_1
    return v0
.end method

.method public increaseAdPlace()V
    .locals 1

    .line 118
    iget v0, p0, Lcom/in2wow/sdk/p;->b:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/in2wow/sdk/p;->b:I

    return-void
.end method

.method public isFirstRequest(Ljava/lang/String;)Z
    .locals 1

    .line 202
    iget-object v0, p0, Lcom/in2wow/sdk/p;->a:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 203
    iget-object v0, p0, Lcom/in2wow/sdk/p;->a:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/Boolean;

    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p1

    return p1

    :cond_0
    const/4 p1, 0x1

    return p1
.end method

.method public isInStreamServingRange(I)Z
    .locals 3

    const/4 v0, 0x1

    add-int/2addr p1, v0

    .line 88
    iget v1, p0, Lcom/in2wow/sdk/p;->c:I

    const/4 v2, 0x0

    if-ge p1, v1, :cond_0

    return v2

    .line 94
    :cond_0
    iget v1, p0, Lcom/in2wow/sdk/p;->d:I

    if-le p1, v1, :cond_1

    return v2

    :cond_1
    return v0
.end method

.method public isOverLastAddPosition(Ljava/lang/String;II)Z
    .locals 0

    .line 103
    invoke-virtual {p0, p1}, Lcom/in2wow/sdk/p;->getLastAddedPosition(Ljava/lang/String;)I

    move-result p1

    add-int/2addr p1, p3

    if-lt p2, p1, :cond_0

    const/4 p1, 0x1

    return p1

    :cond_0
    const/4 p1, 0x0

    return p1
.end method

.method public resetPosition()V
    .locals 1

    const/4 v0, 0x1

    .line 128
    iput v0, p0, Lcom/in2wow/sdk/p;->b:I

    const/4 v0, -0x1

    .line 129
    iput v0, p0, Lcom/in2wow/sdk/p;->g:I

    .line 130
    iput v0, p0, Lcom/in2wow/sdk/p;->f:I

    .line 131
    iget-object v0, p0, Lcom/in2wow/sdk/p;->e:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    .line 132
    iget-object v0, p0, Lcom/in2wow/sdk/p;->a:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    return-void
.end method

.method public setFirstRequest(Ljava/lang/String;Z)V
    .locals 1

    .line 211
    iget-object v0, p0, Lcom/in2wow/sdk/p;->a:Ljava/util/Map;

    invoke-static {p2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object p2

    invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setFirstVisiblePosition(I)V
    .locals 0

    .line 154
    iput p1, p0, Lcom/in2wow/sdk/p;->g:I

    return-void
.end method

.method public setLastAddedPosition(Ljava/lang/String;I)V
    .locals 1

    if-eqz p1, :cond_0

    .line 148
    iget-object v0, p0, Lcom/in2wow/sdk/p;->e:Ljava/util/Map;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p2

    invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    return-void
.end method

.method public setLastVisiblePosition(I)V
    .locals 0

    .line 159
    iput p1, p0, Lcom/in2wow/sdk/p;->f:I

    return-void
.end method

.method public setStreamMaximumServingPosition(I)V
    .locals 0

    .line 142
    iput p1, p0, Lcom/in2wow/sdk/p;->d:I

    return-void
.end method

.method public setStreamMinimumServingPosition(I)V
    .locals 0

    .line 137
    iput p1, p0, Lcom/in2wow/sdk/p;->c:I

    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .line 192
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "Place["

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

    iget v1, p0, Lcom/in2wow/sdk/p;->b:I

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

    const-string v1, "]"

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

    const-string v1, "FirstV["

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

    iget v1, p0, Lcom/in2wow/sdk/p;->g:I

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

    const-string v1, "]"

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

    const-string v1, "LastV["

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

    iget v1, p0, Lcom/in2wow/sdk/p;->f:I

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

    const-string v1, "]"

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

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

    move-result-object v0

    return-object v0
.end method
