LazyForeignCollection.smali
.class public Lcom/j256/ormlite/dao/LazyForeignCollection;
.super Lcom/j256/ormlite/dao/BaseForeignCollection;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
"ID:",
"Ljava/lang/Object;",
">",
"Lcom/j256/ormlite/dao/BaseForeignCollection<",
"TT;TID;>;"
}
.end annotation
# static fields
.field private static final serialVersionUID:J = -0x4bc855175671af79L
# instance fields
.field private transient lastIterator:Lcom/j256/ormlite/dao/CloseableIterator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Lcom/j256/ormlite/dao/Dao;Ljava/lang/Object;Ljava/lang/Object;Lcom/j256/ormlite/field/FieldType;Ljava/lang/String;Z)V
.registers 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/j256/ormlite/dao/Dao<",
"TT;TID;>;",
"Ljava/lang/Object;",
"Ljava/lang/Object;",
"Lcom/j256/ormlite/field/FieldType;",
"Ljava/lang/String;",
"Z)V"
}
.end annotation
invoke-direct/range {p0 .. p6}, Lcom/j256/ormlite/dao/BaseForeignCollection;-><init>(Lcom/j256/ormlite/dao/Dao;Ljava/lang/Object;Ljava/lang/Object;Lcom/j256/ormlite/field/FieldType;Ljava/lang/String;Z)V
return-void
.end method
.method public static synthetic access$000(Lcom/j256/ormlite/dao/LazyForeignCollection;I)Lcom/j256/ormlite/dao/CloseableIterator;
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/sql/SQLException;
}
.end annotation
invoke-direct {p0, p1}, Lcom/j256/ormlite/dao/LazyForeignCollection;->seperateIteratorThrow(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object p0
return-object p0
.end method
.method private seperateIteratorThrow(I)Lcom/j256/ormlite/dao/CloseableIterator;
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/sql/SQLException;
}
.end annotation
.line 1
iget-object v0, p0, Lcom/j256/ormlite/dao/BaseForeignCollection;->dao:Lcom/j256/ormlite/dao/Dao;
if-eqz v0, :cond_d
.line 2
invoke-virtual {p0}, Lcom/j256/ormlite/dao/BaseForeignCollection;->getPreparedQuery()Lcom/j256/ormlite/stmt/PreparedQuery;
move-result-object v1
invoke-interface {v0, v1, p1}, Lcom/j256/ormlite/dao/Dao;->iterator(Lcom/j256/ormlite/stmt/PreparedQuery;I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object p1
return-object p1
.line 3
:cond_d
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "Internal DAO object is null. Maybe the collection was deserialized or otherwise constructed wrongly. Use dao.assignEmptyForeignCollection(...) or dao.getEmptyForeignCollection(...) instead"
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
# virtual methods
.method public closeLastIterator()V
.registers 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 1
iget-object v0, p0, Lcom/j256/ormlite/dao/LazyForeignCollection;->lastIterator:Lcom/j256/ormlite/dao/CloseableIterator;
if-eqz v0, :cond_a
.line 2
invoke-interface {v0}, Ljava/io/Closeable;->close()V
const/4 v0, 0x0
.line 3
iput-object v0, p0, Lcom/j256/ormlite/dao/LazyForeignCollection;->lastIterator:Lcom/j256/ormlite/dao/CloseableIterator;
:cond_a
return-void
.end method
.method public closeableIterator()Lcom/j256/ormlite/dao/CloseableIterator;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
const/4 v0, -0x1
.line 1
invoke-virtual {p0, v0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->closeableIterator(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
return-object v0
.end method
.method public closeableIterator(I)Lcom/j256/ormlite/dao/CloseableIterator;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
.line 2
:try_start_0
invoke-virtual {p0, p1}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iteratorThrow(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object p1
:try_end_4
.catch Ljava/sql/SQLException; {:try_start_0 .. :try_end_4} :catch_5
return-object p1
:catch_5
move-exception p1
.line 3
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Could not build lazy iterator for "
.line 4
invoke-static {v1}, Landroid/support/v4/media/c;->c(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
.line 5
iget-object v2, p0, Lcom/j256/ormlite/dao/BaseForeignCollection;->dao:Lcom/j256/ormlite/dao/Dao;
invoke-interface {v2}, Lcom/j256/ormlite/dao/Dao;->getDataClass()Ljava/lang/Class;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v0
.end method
.method public contains(Ljava/lang/Object;)Z
.registers 4
.line 1
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
.line 2
:cond_4
:try_start_4
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_19
.line 3
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v1
:try_end_12
.catchall {:try_start_4 .. :try_end_12} :catchall_1b
if-eqz v1, :cond_4
const/4 p1, 0x1
.line 4
:goto_15
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return p1
:cond_19
const/4 p1, 0x0
goto :goto_15
:catchall_1b
move-exception p1
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw p1
.end method
.method public containsAll(Ljava/util/Collection;)Z
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"*>;)Z"
}
.end annotation
.line 1
new-instance v0, Ljava/util/HashSet;
invoke-direct {v0, p1}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V
.line 2
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object p1
.line 3
:goto_9
:try_start_9
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_17
.line 4
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/util/HashSet;->remove(Ljava/lang/Object;)Z
goto :goto_9
.line 5
:cond_17
invoke-virtual {v0}, Ljava/util/HashSet;->isEmpty()Z
move-result v0
:try_end_1b
.catchall {:try_start_9 .. :try_end_1b} :catchall_1f
.line 6
invoke-static {p1}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return v0
:catchall_1f
move-exception v0
invoke-static {p1}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw v0
.end method
.method public equals(Ljava/lang/Object;)Z
.registers 2
invoke-super {p0, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result p1
return p1
.end method
.method public getWrappedIterable()Lcom/j256/ormlite/dao/CloseableWrappedIterable;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/j256/ormlite/dao/CloseableWrappedIterable<",
"TT;>;"
}
.end annotation
const/4 v0, -0x1
.line 1
invoke-virtual {p0, v0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->getWrappedIterable(I)Lcom/j256/ormlite/dao/CloseableWrappedIterable;
move-result-object v0
return-object v0
.end method
.method public getWrappedIterable(I)Lcom/j256/ormlite/dao/CloseableWrappedIterable;
.registers 4
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Lcom/j256/ormlite/dao/CloseableWrappedIterable<",
"TT;>;"
}
.end annotation
.line 2
new-instance v0, Lcom/j256/ormlite/dao/CloseableWrappedIterableImpl;
new-instance v1, Lcom/j256/ormlite/dao/LazyForeignCollection$1;
invoke-direct {v1, p0, p1}, Lcom/j256/ormlite/dao/LazyForeignCollection$1;-><init>(Lcom/j256/ormlite/dao/LazyForeignCollection;I)V
invoke-direct {v0, v1}, Lcom/j256/ormlite/dao/CloseableWrappedIterableImpl;-><init>(Lcom/j256/ormlite/dao/CloseableIterable;)V
return-object v0
.end method
.method public hashCode()I
.registers 2
invoke-super {p0}, Ljava/lang/Object;->hashCode()I
move-result v0
return v0
.end method
.method public isEager()Z
.registers 2
const/4 v0, 0x0
return v0
.end method
.method public isEmpty()Z
.registers 3
.line 1
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
.line 2
:try_start_4
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
:try_end_8
.catchall {:try_start_4 .. :try_end_8} :catchall_e
xor-int/lit8 v1, v1, 0x1
.line 3
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return v1
:catchall_e
move-exception v1
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw v1
.end method
.method public iterator()Lcom/j256/ormlite/dao/CloseableIterator;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
const/4 v0, -0x1
.line 2
invoke-virtual {p0, v0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->closeableIterator(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
return-object v0
.end method
.method public iterator(I)Lcom/j256/ormlite/dao/CloseableIterator;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
.line 3
invoke-virtual {p0, p1}, Lcom/j256/ormlite/dao/LazyForeignCollection;->closeableIterator(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object p1
return-object p1
.end method
.method public bridge synthetic iterator()Ljava/util/Iterator;
.registers 2
.line 1
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
return-object v0
.end method
.method public iteratorThrow()Lcom/j256/ormlite/dao/CloseableIterator;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/sql/SQLException;
}
.end annotation
const/4 v0, -0x1
.line 1
invoke-virtual {p0, v0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iteratorThrow(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
return-object v0
.end method
.method public iteratorThrow(I)Lcom/j256/ormlite/dao/CloseableIterator;
.registers 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Lcom/j256/ormlite/dao/CloseableIterator<",
"TT;>;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/sql/SQLException;
}
.end annotation
.line 2
invoke-direct {p0, p1}, Lcom/j256/ormlite/dao/LazyForeignCollection;->seperateIteratorThrow(I)Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object p1
iput-object p1, p0, Lcom/j256/ormlite/dao/LazyForeignCollection;->lastIterator:Lcom/j256/ormlite/dao/CloseableIterator;
return-object p1
.end method
.method public refreshAll()I
.registers 3
new-instance v0, Ljava/lang/UnsupportedOperationException;
const-string v1, "Cannot call updateAll() on a lazy collection."
invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public refreshCollection()I
.registers 2
const/4 v0, 0x0
return v0
.end method
.method public remove(Ljava/lang/Object;)Z
.registers 4
.line 1
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
.line 2
:cond_4
:try_start_4
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_1c
.line 3
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_4
.line 4
invoke-interface {v0}, Ljava/util/Iterator;->remove()V
:try_end_17
.catchall {:try_start_4 .. :try_end_17} :catchall_1e
const/4 p1, 0x1
.line 5
:goto_18
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return p1
:cond_1c
const/4 p1, 0x0
goto :goto_18
:catchall_1e
move-exception p1
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw p1
.end method
.method public removeAll(Ljava/util/Collection;)Z
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"*>;)Z"
}
.end annotation
.line 1
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
const/4 v1, 0x0
.line 2
:cond_5
:goto_5
:try_start_5
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_1a
.line 3
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
invoke-interface {p1, v2}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_5
.line 4
invoke-interface {v0}, Ljava/util/Iterator;->remove()V
:try_end_18
.catchall {:try_start_5 .. :try_end_18} :catchall_1e
const/4 v1, 0x1
goto :goto_5
.line 5
:cond_1a
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return v1
:catchall_1e
move-exception p1
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw p1
.end method
.method public size()I
.registers 4
.line 1
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
const/4 v1, 0x0
.line 2
:goto_5
:try_start_5
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_11
.line 3
invoke-interface {v0}, Lcom/j256/ormlite/dao/CloseableIterator;->moveToNext()V
:try_end_e
.catchall {:try_start_5 .. :try_end_e} :catchall_15
add-int/lit8 v1, v1, 0x1
goto :goto_5
.line 4
:cond_11
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return v1
:catchall_15
move-exception v1
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw v1
.end method
.method public toArray()[Ljava/lang/Object;
.registers 4
.line 1
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 2
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v1
.line 3
:goto_9
:try_start_9
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_17
.line 4
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_9
.line 5
:cond_17
invoke-virtual {v0}, Ljava/util/ArrayList;->toArray()[Ljava/lang/Object;
move-result-object v0
:try_end_1b
.catchall {:try_start_9 .. :try_end_1b} :catchall_1f
.line 6
invoke-static {v1}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
return-object v0
:catchall_1f
move-exception v0
invoke-static {v1}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw v0
.end method
.method public toArray([Ljava/lang/Object;)[Ljava/lang/Object;
.registers 11
.annotation system Ldalvik/annotation/Signature;
value = {
"<E:",
"Ljava/lang/Object;",
">([TE;)[TE;"
}
.end annotation
.line 7
invoke-virtual {p0}, Lcom/j256/ormlite/dao/LazyForeignCollection;->iterator()Lcom/j256/ormlite/dao/CloseableIterator;
move-result-object v0
const/4 v1, 0x0
const/4 v2, 0x0
move-object v3, v2
const/4 v4, 0x0
.line 8
:goto_8
:try_start_8
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v5
if-eqz v5, :cond_31
.line 9
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v5
.line 10
array-length v6, p1
if-lt v4, v6, :cond_2c
if-nez v3, :cond_28
.line 11
new-instance v3, Ljava/util/ArrayList;
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
.line 12
array-length v6, p1
const/4 v7, 0x0
:goto_1e
if-ge v7, v6, :cond_28
aget-object v8, p1, v7
.line 13
invoke-virtual {v3, v8}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
add-int/lit8 v7, v7, 0x1
goto :goto_1e
.line 14
:cond_28
invoke-interface {v3, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_2e
.line 15
:cond_2c
aput-object v5, p1, v4
:try_end_2e
.catchall {:try_start_8 .. :try_end_2e} :catchall_43
:goto_2e
add-int/lit8 v4, v4, 0x1
goto :goto_8
.line 16
:cond_31
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
if-nez v3, :cond_3e
.line 17
array-length v0, p1
add-int/lit8 v0, v0, -0x1
if-ge v4, v0, :cond_3d
.line 18
aput-object v2, p1, v4
:cond_3d
return-object p1
.line 19
:cond_3e
invoke-interface {v3, p1}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
move-result-object p1
return-object p1
:catchall_43
move-exception p1
.line 20
invoke-static {v0}, Lcom/j256/ormlite/misc/IOUtils;->closeQuietly(Ljava/io/Closeable;)V
throw p1
.end method
.method public updateAll()I
.registers 3
new-instance v0, Ljava/lang/UnsupportedOperationException;
const-string v1, "Cannot call updateAll() on a lazy collection."
invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw v0
.end method