use of com.genonbeta.TrebleShot.object.TransactionObject in project TrebleShot by genonbeta.
the class AccessDatabase method calculateTransactionSize.
public void calculateTransactionSize(int groupId, TransactionObject.Group.Index indexObject) {
indexObject.reset();
ArrayList<TransactionObject> transactionList = castQuery(new SQLQuery.Select(AccessDatabase.TABLE_TRANSFER).setWhere(AccessDatabase.FIELD_TRANSFER_GROUPID + "=? AND " + AccessDatabase.FIELD_TRANSFER_FLAG + " != ?", String.valueOf(groupId), TransactionObject.Flag.REMOVED.toString()), TransactionObject.class);
for (TransactionObject transactionObject : transactionList) {
if (TransactionObject.Type.INCOMING.equals(transactionObject.type)) {
indexObject.incoming += transactionObject.fileSize;
indexObject.incomingCount++;
} else {
indexObject.outgoing += transactionObject.fileSize;
indexObject.outgoingCount++;
}
}
}
Aggregations