org.android.activityminer.model.classification
Class ActivityImpl

Package class diagram package ActivityImpl
java.lang.Object
  extended by org.android.activityminer.model.classification.ActivityImpl
All Implemented Interfaces:
Activity
Direct Known Subclasses:
TrainingActivity

public class ActivityImpl
extends Object
implements Activity

The activity representation for classification.
An activity does is an extended feature vector, which may also know its class.


Field Summary
private  long classid
          The class attribute value.
protected  FeatureVector featureVector
          The feature vector.
 
Constructor Summary
ActivityImpl(FeatureVector featureVector)
          Constructor
ActivityImpl(FeatureVector featureVector, long classid)
          Constructor
 
Method Summary
 long getActivityClass()
          Getter for the class identifier.
 int getAttributeCount()
          Getter for the attribute count.
 String[] getAttributes()
          Getter for the attributes in its internal natural order.
 double[] getPoint()
          Getter for the attribute values (unboxed from the double type) in the internal order of the attributes.
 Long getTimeStamp()
          Getter for the time stamp.
 Double getValue(int idxAttribute)
          Getter for an attributes value.
 Double getValue(String attribute)
          Getter for an attributes value.
 Double[] getValues()
          Getter for the attribute values in the internal order of the attributes.
 boolean hasActivityClass()
          Test method if class is set.
 void setActivityClass(long classId)
          Setter for the class identifier
 void setValue(int idxAttribute, Double value)
          Does set a value at the given attribute index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

featureVector

protected final FeatureVector featureVector
The feature vector.


classid

private long classid
The class attribute value.

Constructor Detail

ActivityImpl

public ActivityImpl(FeatureVector featureVector,
                    long classid)
Constructor

Parameters:
featureVector - the feature vector to create from
classid - the class identifier (-1 if unknown)

ActivityImpl

public ActivityImpl(FeatureVector featureVector)
Constructor

Parameters:
featureVector - the feature vector to create from
Method Detail

hasActivityClass

public final boolean hasActivityClass()
Description copied from interface: Activity
Test method if class is set.

Specified by:
hasActivityClass in interface Activity
Returns:
true if the class is set

getActivityClass

public final long getActivityClass()
Description copied from interface: Activity
Getter for the class identifier.

Specified by:
getActivityClass in interface Activity
Returns:
the class identifer

setActivityClass

public final void setActivityClass(long classId)
Setter for the class identifier

Parameters:
classId - the class identifier to set

getTimeStamp

public final Long getTimeStamp()
Description copied from interface: Activity
Getter for the time stamp.

Specified by:
getTimeStamp in interface Activity
Returns:
the time stamp in milliseconds

getValue

public final Double getValue(String attribute)
Description copied from interface: Activity
Getter for an attributes value.

Specified by:
getValue in interface Activity
Parameters:
attribute - the attribute name
Returns:
the value for the given attribute

setValue

public void setValue(int idxAttribute,
                     Double value)
Description copied from interface: Activity
Does set a value at the given attribute index

Specified by:
setValue in interface Activity
Parameters:
idxAttribute - the attribute index
value - the value to set

getValue

public Double getValue(int idxAttribute)
Description copied from interface: Activity
Getter for an attributes value.

Specified by:
getValue in interface Activity
Parameters:
idxAttribute - the attribute index
Returns:
the value for the given attribute idxAttribute

getAttributes

public String[] getAttributes()
Description copied from interface: Activity
Getter for the attributes in its internal natural order.

Specified by:
getAttributes in interface Activity
Returns:
the attributes of this sample

getPoint

public double[] getPoint()
Description copied from interface: Activity
Getter for the attribute values (unboxed from the double type) in the internal order of the attributes.

Specified by:
getPoint in interface Activity
Returns:
the attribute values of this sample

getAttributeCount

public int getAttributeCount()
Description copied from interface: Activity
Getter for the attribute count.

Specified by:
getAttributeCount in interface Activity
Returns:
the count of attributes

getValues

public Double[] getValues()
Description copied from interface: Activity
Getter for the attribute values in the internal order of the attributes.

Specified by:
getValues in interface Activity
Returns:
the attribute values of this sample