public class ActivitySegment extends Object
Modifier and Type | Field and Description |
---|---|
static int |
HRRECOVERY_UNDEFINED |
Constructor and Description |
---|
ActivitySegment()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addRecord(ActivityRecord record)
Add a record to the segment.
|
void |
compress(double maxError)
Compress segment using the Douglas-Peucker method.
|
void |
dumpSegmentCsv(Writer writer,
boolean withHeader)
Dump the records in this segment as CSV.
|
int |
getCycles()
Returns the number of cycles; Running: steps, Cycling: cranc rotations
|
double |
getDistance()
Returns the distance of this activity segment
|
hirondelle.date4j.DateTime |
getEndTime()
Get the end time
|
int |
getHeartRateRecovery()
Returns the heart rate recovery at the end of the segment
|
int |
getHeartRateRecoveryScore()
Returns the score associated with the heart rate recovery at the end of the segment
|
String |
getHeartRateRecoveryScoreString()
Returns the heart reate recovery score associated with the recovery
|
ActivityRecord |
getRecord(int index)
Get the record at given index
|
List<ActivityRecord> |
getRecords()
Returns the array of records in this activity segments
|
hirondelle.date4j.DateTime |
getStartTime()
Get the start time
|
int |
numberOfRecords()
Return the number of records in this segment
|
void |
setEndTime(int seconds)
Set the end time of this segment as local time
|
void |
setHeartRateRecovery(int recovery,
int score)
Sets the heart rate recovery
|
static void |
setLocalTimeZone(TimeZone timeZone)
Set the time zone of the local time to use
|
void |
setStartTime(int seconds)
Set start time of this semgent as local time
|
public static final int HRRECOVERY_UNDEFINED
public void addRecord(ActivityRecord record)
record
- The record to addpublic int numberOfRecords()
public ActivityRecord getRecord(int index)
index
- The index of the record to retrievepublic List<ActivityRecord> getRecords()
public static void setLocalTimeZone(TimeZone timeZone)
timeZone
- The time zone corresponding to the local timepublic void setStartTime(int seconds)
seconds
- Local Time seconds in the epoch erapublic hirondelle.date4j.DateTime getStartTime()
public void setEndTime(int seconds)
seconds
- The epoch secondspublic hirondelle.date4j.DateTime getEndTime()
public void setHeartRateRecovery(int recovery, int score)
recovery
- Recovery after one minute as decrease in bpmscore
- Score (1-5?)public int getHeartRateRecovery()
public int getHeartRateRecoveryScore()
public String getHeartRateRecoveryScoreString()
public int getCycles()
public void dumpSegmentCsv(Writer writer, boolean withHeader) throws IOException
writer
- Writer to dump towithHeader
- Indicates whether to dump the CSV header or notIOException
- Thrown when an error occurs during writingpublic double getDistance()
public void compress(double maxError)
maxError
- Measure for the maximum errorCopyright © 2023. All rights reserved.