.class public final Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;
.super Ljava/lang/Object;
.source "AlarmClockData.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/alarm/clock/AlarmClockData;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "DaysOfWeek"
.end annotation


# static fields
.field private static final a:[I


# instance fields
.field private b:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x7

    .line 141
    new-array v0, v0, [I

    fill-array-data v0, :array_0

    sput-object v0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->a:[I

    return-void

    nop

    :array_0
    .array-data 4
        0x2
        0x3
        0x4
        0x5
        0x6
        0x7
        0x1
    .end array-data
.end method

.method public constructor <init>(I)V
    .locals 0

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

    .line 147
    iput p1, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    return-void
.end method

.method private a(I)Z
    .locals 2

    .line 196
    iget v0, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    const/4 v1, 0x1

    shl-int p1, v1, p1

    and-int/2addr p1, v0

    if-lez p1, :cond_0

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    :goto_0
    return v1
.end method


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

    .line 212
    iget v0, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    return v0
.end method

.method public a(Ljava/util/Calendar;)I
    .locals 3

    .line 229
    iget v0, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    if-nez v0, :cond_0

    const/4 p1, -0x1

    return p1

    :cond_0
    const/4 v0, 0x7

    .line 233
    invoke-virtual {p1, v0}, Ljava/util/Calendar;->get(I)I

    move-result p1

    add-int/lit8 p1, p1, 0x5

    rem-int/2addr p1, v0

    const/4 v1, 0x0

    :goto_0
    if-ge v1, v0, :cond_2

    add-int v2, p1, v1

    .line 238
    rem-int/2addr v2, v0

    .line 239
    invoke-direct {p0, v2}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->a(I)Z

    move-result v2

    if-eqz v2, :cond_1

    goto :goto_1

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

    goto :goto_0

    :cond_2
    :goto_1
    return v1
.end method

.method public a(Landroid/content/Context;Z)Ljava/lang/String;
    .locals 6

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

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

    .line 154
    iget v1, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    if-nez v1, :cond_1

    if-eqz p2, :cond_0

    .line 155
    sget p2, Lcom/moji/alarm/R$string;->never:I

    invoke-virtual {p1, p2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object p1

    invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object p1

    goto :goto_0

    :cond_0
    const-string p1, ""

    :goto_0
    return-object p1

    .line 159
    :cond_1
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    const/16 v1, 0x7f

    if-ne p2, v1, :cond_2

    .line 160
    sget p2, Lcom/moji/alarm/R$string;->every_day:I

    invoke-virtual {p1, p2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object p1

    invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 163
    :cond_2
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    const/16 v1, 0x1f

    if-ne p2, v1, :cond_3

    .line 164
    sget p2, Lcom/moji/alarm/R$string;->working_day:I

    invoke-virtual {p1, p2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object p1

    invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 167
    :cond_3
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    const/16 v1, 0x60

    if-ne p2, v1, :cond_4

    .line 168
    sget p2, Lcom/moji/alarm/R$string;->weekend:I

    invoke-virtual {p1, p2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object p1

    invoke-interface {p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 172
    :cond_4
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    const/4 v1, 0x0

    const/4 v2, 0x0

    :goto_1
    const/4 v3, 0x1

    if-lez p2, :cond_6

    and-int/lit8 v4, p2, 0x1

    if-ne v4, v3, :cond_5

    add-int/lit8 v2, v2, 0x1

    :cond_5
    shr-int/lit8 p2, p2, 0x1

    goto :goto_1

    .line 180
    :cond_6
    new-instance p2, Ljava/text/DateFormatSymbols;

    invoke-direct {p2}, Ljava/text/DateFormatSymbols;-><init>()V

    if-le v2, v3, :cond_7

    .line 181
    invoke-virtual {p2}, Ljava/text/DateFormatSymbols;->getShortWeekdays()[Ljava/lang/String;

    move-result-object p2

    goto :goto_2

    :cond_7
    invoke-virtual {p2}, Ljava/text/DateFormatSymbols;->getWeekdays()[Ljava/lang/String;

    move-result-object p2

    :goto_2
    const/4 v4, 0x7

    if-ge v1, v4, :cond_9

    .line 185
    iget v4, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    shl-int v5, v3, v1

    and-int/2addr v4, v5

    if-eqz v4, :cond_8

    .line 186
    sget-object v4, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->a:[I

    aget v4, v4, v1

    aget-object v4, p2, v4

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

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

    if-lez v2, :cond_8

    .line 189
    sget v4, Lcom/moji/alarm/R$string;->day_concat:I

    invoke-virtual {p1, v4}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object v4

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

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

    goto :goto_2

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

    move-result-object p2

    sget v0, Lcom/moji/alarm/R$string;->week:I

    invoke-virtual {p1, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    sget v1, Lcom/moji/alarm/R$string;->week_zhou:I

    invoke-virtual {p1, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p2, v0, p1}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method public a(IZ)V
    .locals 1

    const/4 v0, 0x1

    if-eqz p2, :cond_0

    .line 201
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    shl-int p1, v0, p1

    or-int/2addr p1, p2

    iput p1, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    goto :goto_0

    .line 203
    :cond_0
    iget p2, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    shl-int p1, v0, p1

    xor-int/lit8 p1, p1, -0x1

    and-int/2addr p1, p2

    iput p1, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    :goto_0
    return-void
.end method

.method public b()[Z
    .locals 4

    const/4 v0, 0x7

    .line 217
    new-array v1, v0, [Z

    const/4 v2, 0x0

    :goto_0
    if-ge v2, v0, :cond_0

    .line 219
    invoke-direct {p0, v2}, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->a(I)Z

    move-result v3

    aput-boolean v3, v1, v2

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_0
    return-object v1
.end method

.method public c()Z
    .locals 1

    .line 225
    iget v0, p0, Lcom/moji/alarm/clock/AlarmClockData$DaysOfWeek;->b:I

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method
