-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPassThroughAlgorithm.java
41 lines (32 loc) · 1.21 KB
/
PassThroughAlgorithm.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// PassThroughAlgorithm.java
// PassThroughRecipes
//
// Created by Philip Kuryloski on 2011-07-11.
// Copyright 2011 University of California, Berkeley. All rights reserved.
//
package edu.berkeley.waverecipe.passthrough;
import edu.berkeley.androidwave.waverecipe.waverecipealgorithm.*;
import android.util.Log;
import java.util.HashMap;
import java.util.Map;
public class PassThroughAlgorithm implements WaveRecipeAlgorithm {
private static final String TAG = PassThroughAlgorithm.class.getSimpleName();
WaveRecipeAlgorithmListener theListener;
public void setAuthorizedMaxOutputRate(double maxOutputRate) {
// empty method as input and output rates are by definition equal in
// a pass through recipe
}
public boolean setWaveRecipeAlgorithmListener(Object listener) {
try {
theListener = new WaveRecipeAlgorithmListenerShadow(listener);
return true;
} catch (Exception e) {
Log.w(TAG, "Exception in setWaveRecipeAlgorithmListener", e);
}
return false;
}
public void ingestSensorData(long time, Map<String, Double> values) {
theListener.handleRecipeData(time, values);
}
}