78 lines
1.8 KiB
Java
78 lines
1.8 KiB
Java
package com.liulishuo.filedownloader.model;
|
|
|
|
import android.content.ContentValues;
|
|
import com.liulishuo.filedownloader.util.FileDownloadUtils;
|
|
import com.ubt.jimu.controller.data.widget.JockstickDataConverter;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ConnectionModel {
|
|
private int a;
|
|
private int b;
|
|
private long c;
|
|
private long d;
|
|
private long e;
|
|
|
|
public void a(int i) {
|
|
this.a = i;
|
|
}
|
|
|
|
public void b(int i) {
|
|
this.b = i;
|
|
}
|
|
|
|
public int c() {
|
|
return this.a;
|
|
}
|
|
|
|
public int d() {
|
|
return this.b;
|
|
}
|
|
|
|
public long e() {
|
|
return this.c;
|
|
}
|
|
|
|
public ContentValues f() {
|
|
ContentValues contentValues = new ContentValues();
|
|
contentValues.put(JockstickDataConverter.ID, Integer.valueOf(this.a));
|
|
contentValues.put("connectionIndex", Integer.valueOf(this.b));
|
|
contentValues.put("startOffset", Long.valueOf(this.c));
|
|
contentValues.put("currentOffset", Long.valueOf(this.d));
|
|
contentValues.put("endOffset", Long.valueOf(this.e));
|
|
return contentValues;
|
|
}
|
|
|
|
public String toString() {
|
|
return FileDownloadUtils.a("id[%d] index[%d] range[%d, %d) current offset(%d)", Integer.valueOf(this.a), Integer.valueOf(this.b), Long.valueOf(this.c), Long.valueOf(this.e), Long.valueOf(this.d));
|
|
}
|
|
|
|
public long a() {
|
|
return this.d;
|
|
}
|
|
|
|
public long b() {
|
|
return this.e;
|
|
}
|
|
|
|
public void c(long j) {
|
|
this.c = j;
|
|
}
|
|
|
|
public void a(long j) {
|
|
this.d = j;
|
|
}
|
|
|
|
public void b(long j) {
|
|
this.e = j;
|
|
}
|
|
|
|
public static long a(List<ConnectionModel> list) {
|
|
long j = 0;
|
|
for (ConnectionModel connectionModel : list) {
|
|
j += connectionModel.a() - connectionModel.e();
|
|
}
|
|
return j;
|
|
}
|
|
}
|