Android Open Source - WAIDRecognizer Vehicle Manager






From Project

Back to project page WAIDRecognizer.

License

The source code is released under:

GNU General Public License

If you think the Android project WAIDRecognizer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * /*from  w w  w.j  a v a 2s . c o  m*/
 */
package it.unibo.cs.jonus.waidrec;

import android.content.Context;
import android.hardware.SensorManager;

/**
 * @author jei
 * 
 */
public abstract class VehicleManager {

  public static final int DEFAULT_SAMPLING_DELAY = 5000;

  private Context mContext = null;
  protected ModelManager mModelManager = null;
  protected SensorManager mSensorManager = null;
  protected long samplingDelay = DEFAULT_SAMPLING_DELAY;

  /**
   * Constructor method for VehicleManager
   * 
   * @param context
   *            the context to use for this VehicleManager
   */
  public VehicleManager(Context context, ModelManager modelManager, long delay) {
    mContext = context;
    mModelManager = modelManager;
    mSensorManager = (SensorManager) mContext
        .getSystemService(Context.SENSOR_SERVICE);
    samplingDelay = delay;
  }
  
  /**
   * Constructor method for VehicleManager
   * 
   * @param context
   *            the context to use for this VehicleManager
   */
  public VehicleManager(Context context, ModelManager modelManager) {
    this(context, modelManager, DEFAULT_SAMPLING_DELAY);
  }

  /**
   * Set the classification delay
   * 
   * @param milliseconds
   *            the sampling delay in milliseconds
   */
  public void setSamplingDelay(long milliseconds) {
    samplingDelay = milliseconds;
  }

  /**
   * Get the classification delay
   * 
   * @return the sampling delay in milliseconds
   */
  public long getSamplingDelay() {
    return samplingDelay;
  }
  
  /**
   * Set the model manager of this VehicleManager
   * 
   * @param modelManager the ModelManager for this VehicleManager
   */
  public void setModelManager(ModelManager modelManager) {
    this.mModelManager = modelManager;
  }
  
  /**
   * Get the model manager used by this VehicleManager
   * @return the ModelManager
   */
  public ModelManager getModelManager() {
    return mModelManager;
  }

  /**
   * Register a vehicle observer for this vehicle manager and start generating
   * vehicle instances
   * 
   * @param observer
   *            the VehicleObserver to use for callbacks
   */
  public abstract boolean registerVehicleObserver(VehicleObserver observer);

  /**
   * Unregister the vehicle observer for this vehicle manager and stop
   * generating vehicle instances
   * 
   */
  public abstract boolean unregisterVehicleObserver(VehicleObserver observer);

}




Java Source Code List

it.unibo.cs.jonus.waidrec.AddVehicleDialog.java
it.unibo.cs.jonus.waidrec.DatabaseOpenHelper.java
it.unibo.cs.jonus.waidrec.EvaluationsProvider.java
it.unibo.cs.jonus.waidrec.HistoryFragment.java
it.unibo.cs.jonus.waidrec.HistoryListAdapter.java
it.unibo.cs.jonus.waidrec.HistorySelectorAdapter.java
it.unibo.cs.jonus.waidrec.MagnitudeFeatures.java
it.unibo.cs.jonus.waidrec.MagnitudeListener.java
it.unibo.cs.jonus.waidrec.MainActivity.java
it.unibo.cs.jonus.waidrec.MainPrefsActivity.java
it.unibo.cs.jonus.waidrec.ModelManager.java
it.unibo.cs.jonus.waidrec.RecognizerFragment.java
it.unibo.cs.jonus.waidrec.RecognizerService.java
it.unibo.cs.jonus.waidrec.TrainingFragment.java
it.unibo.cs.jonus.waidrec.TrainingService.java
it.unibo.cs.jonus.waidrec.VIListAdapter.java
it.unibo.cs.jonus.waidrec.VehicleInstance.java
it.unibo.cs.jonus.waidrec.VehicleItem.java
it.unibo.cs.jonus.waidrec.VehicleManager.java
it.unibo.cs.jonus.waidrec.VehicleObserver.java
it.unibo.cs.jonus.waidrec.VehicleRecognizer.java
it.unibo.cs.jonus.waidrec.VehicleTrainer.java
it.unibo.cs.jonus.waidrec.VehiclesFragment.java
it.unibo.cs.jonus.waidrec.VehiclesListAdapter.java