org.android.activityminer.model.features
Class FeatureVector

Package class diagram package FeatureVector
java.lang.Object
  extended by org.android.activityminer.model.features.FeatureVector
All Implemented Interfaces:
SerializableData, ObservableEvent

public class FeatureVector
extends Object
implements ObservableEvent, SerializableData

The lightweight feature vector representation which does just hold the calculated feature values accessible by their types.


Field Summary
private  SparseArray<Double> mapValue2FeatureType
          The map with the values per feature dimension.
private  Long timeStamp
          The time stamp for the feature vector.
 
Constructor Summary
FeatureVector()
          Constructor
 
Method Summary
 Double get(FeatureTypes type)
          Getter for the value of a specific feature type
 SparseArray<Double> getMapValue2FeatureDimension()
          Getter for the map with the values per feature dimension.
 Long getTimeStamp()
          Getter for the time stamp.
 FeatureTypes[] getTypes()
          Getter for the feature types
 Double[] getValues()
          Getter for the values.
 void set(FeatureTypes dim, Double value)
          Setter for the feature value of a specific feature type.
 void setMapValue2FeatureDimension(SparseArray<Double> mapValue2FeatureType)
          Setter for the map with the values per feature type.
 void setTimeStamp(Long ts)
          Setter for the time-stamp
 int size()
          Getter for the size.
 String toXML()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapValue2FeatureType

private SparseArray<Double> mapValue2FeatureType
The map with the values per feature dimension.


timeStamp

private Long timeStamp
The time stamp for the feature vector.

Constructor Detail

FeatureVector

public FeatureVector()
Constructor

Method Detail

setMapValue2FeatureDimension

public final void setMapValue2FeatureDimension(SparseArray<Double> mapValue2FeatureType)
Setter for the map with the values per feature type.

Parameters:
mapValue2FeatureType - the map with the feature value pairs

getMapValue2FeatureDimension

public final SparseArray<Double> getMapValue2FeatureDimension()
Getter for the map with the values per feature dimension.

Returns:
the map with the values per feature dimension

getTimeStamp

public final Long getTimeStamp()
Getter for the time stamp.

Returns:
the time stamp in milliseconds

setTimeStamp

public final void setTimeStamp(Long ts)
Setter for the time-stamp

Parameters:
ts - the time-stamp to set

getValues

public final Double[] getValues()
Getter for the values.

Returns:
the array with the values for all features types

getTypes

public final FeatureTypes[] getTypes()
Getter for the feature types

Returns:
the contained types array

get

public final Double get(FeatureTypes type)
Getter for the value of a specific feature type

Parameters:
type - the feature type identifier
Returns:
the value for the given feature type

set

public final void set(FeatureTypes dim,
                      Double value)
Setter for the feature value of a specific feature type.

Parameters:
dim - the feature type to set the value for
value - the value to set

toXML

public final String toXML()
                   throws Exception
Specified by:
toXML in interface SerializableData
Throws:
Exception

size

public int size()
Getter for the size.

Returns:
the size