org.android.activityminer.logic.util
Class AbstractActivatableComponentImpl

Package class diagram package AbstractActivatableComponentImpl
java.lang.Object
  extended by org.android.activityminer.logic.util.AbstractActivatableComponentImpl
All Implemented Interfaces:
ActivatableComponent
Direct Known Subclasses:
AbstractAccelerometerDataSource, AccelerometerDataCache, GlobalSharedPreferenceObserver, LocationDataCache, LocationDataSource, SensorObservationCache, SensorObservationTask

public abstract class AbstractActivatableComponentImpl
extends Object
implements ActivatableComponent

Implementation of the activatable component.


Field Summary
private  AtomicBoolean active
          Activation state flag
 
Constructor Summary
AbstractActivatableComponentImpl()
          Constructor
 
Method Summary
 boolean isActive()
          Test method for the actiation state.
protected abstract  void onActivationStateChange(boolean active)
          Handler for activation state changes
 void setActivationState(boolean active)
          Method to set the activation state of the component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

active

private final AtomicBoolean active
Activation state flag

Constructor Detail

AbstractActivatableComponentImpl

public AbstractActivatableComponentImpl()
Constructor

Method Detail

setActivationState

public final void setActivationState(boolean active)
Description copied from interface: ActivatableComponent
Method to set the activation state of the component

Specified by:
setActivationState in interface ActivatableComponent
Parameters:
active - the activation sate flag

onActivationStateChange

protected abstract void onActivationStateChange(boolean active)
Handler for activation state changes

Parameters:
active - the new activation state

isActive

public final boolean isActive()
Description copied from interface: ActivatableComponent
Test method for the actiation state.

Specified by:
isActive in interface ActivatableComponent
Returns:
true if active, false otherwise