Implement changeStoredSamplesType()
This commit is contained in:
parent
876bdac918
commit
4b374e3f7e
|
@ -98,14 +98,20 @@ public abstract class AbstractSampleProvider<T extends AbstractActivitySample> i
|
|||
//
|
||||
|
||||
public void changeStoredSamplesType(int timestampFrom, int timestampTo, int kind) {
|
||||
// TODO: implement
|
||||
List<T> samples = getAllActivitySamples(timestampFrom, timestampTo);
|
||||
for (T sample : samples) {
|
||||
sample.setRawKind(kind);
|
||||
}
|
||||
getSampleDao().updateInTx(samples);
|
||||
}
|
||||
|
||||
public void changeStoredSamplesType(int timestampFrom, int timestampTo, int fromKind, int toKind) {
|
||||
// TODO: implement
|
||||
List<T> samples = getGBActivitySamples(timestampFrom, timestampTo, fromKind);
|
||||
for (T sample : samples) {
|
||||
sample.setRawKind(toKind);
|
||||
}
|
||||
getSampleDao().updateInTx(samples);
|
||||
}
|
||||
|
||||
//// SQLiteDatabase getWritableDatabase();
|
||||
|
||||
protected List<T> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityType) {
|
||||
QueryBuilder<T> qb = getSampleDao().queryBuilder();
|
||||
|
|
|
@ -26,6 +26,10 @@ public abstract class AbstractActivitySample implements ActivitySample {
|
|||
return getProvider().normalizeIntensity(getRawIntensity());
|
||||
}
|
||||
|
||||
public abstract void setRawKind(int kind);
|
||||
|
||||
public abstract void setRawIntensity(int intensity);
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + "{" +
|
||||
|
|
Loading…
Reference in New Issue