Package de.hirola.sportslibrary.model
Class RunningPlanEntry
- java.lang.Object
-
- de.hirola.kintojava.model.KintoObject
-
- de.hirola.sportslibrary.PersistentObject
-
- de.hirola.sportslibrary.model.RunningPlanEntry
-
- All Implemented Interfaces:
de.hirola.kintojava.model.KintoModel
public class RunningPlanEntry extends PersistentObject
Copyright 2021 by Michael Schmidt, Hirola Consulting This software us licensed under the AGPL-3.0 or later. An entry in the running plan contains the day and the respective training sections for the individual weeks. An example: Week: 3, Day: 1 (Monday), 7 min total, 2 min run, 3 min slow walk, 2 min run- Since:
- 1.1.1
- Author:
- Michael Schmidt (Hirola)
-
-
Constructor Summary
Constructors Constructor Description RunningPlanEntry()Default constructor for reflection.RunningPlanEntry(int day, int week, @NotNull ArrayList<RunningUnit> runningUnits)Create a running plan entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetDay()Get the (rounded) percentage of completed training sessions.longgetDuration()The total duration of the training session in minutes, i.e. the sum of the individual training sections.List<String>getIdentityAttributeNames()Get a list of all (persistent) attribute names of the objectList<RunningUnit>getRunningUnits()Get the (rounded) percentage of completed training sessions.intgetWeek()Get the (rounded) percentage of completed training sessions.inthashCode()booleanisCompleted()Indicates whether the run plan entry (training day) has been completed.intpercentCompleted()(Rounded) percentage of run segments completed.
-
-
-
Constructor Detail
-
RunningPlanEntry
public RunningPlanEntry()
Default constructor for reflection.
-
RunningPlanEntry
public RunningPlanEntry(int day, int week, @NotNull @NotNull ArrayList<RunningUnit> runningUnits)Create a running plan entry.- Parameters:
day- of entryweek- of entryrunningUnits- of entry- See Also:
RunningUnit
-
-
Method Detail
-
getDay
public int getDay()
Get the (rounded) percentage of completed training sessions.- Returns:
- The (rounded) percentage of completed training sessions
-
getWeek
public int getWeek()
Get the (rounded) percentage of completed training sessions.- Returns:
- The (rounded) percentage of completed training sessions
-
getRunningUnits
public List<RunningUnit> getRunningUnits()
Get the (rounded) percentage of completed training sessions.- Returns:
- The (rounded) percentage of completed training sessions
-
getDuration
public long getDuration()
The total duration of the training session in minutes, i.e. the sum of the individual training sections.- Returns:
- Sum of the individual training sections in minutes
-
isCompleted
public boolean isCompleted()
Indicates whether the run plan entry (training day) has been completed. Is automatically true if all training sections are completed.- Returns:
- A flag to determine if all units of entry completed
-
percentCompleted
public int percentCompleted()
(Rounded) percentage of run segments completed.- Returns:
- Percentage of run segments completed
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classde.hirola.kintojava.model.KintoObject
-
hashCode
public int hashCode()
- Overrides:
hashCodein classde.hirola.kintojava.model.KintoObject
-
getIdentityAttributeNames
public List<String> getIdentityAttributeNames()
Description copied from class:PersistentObjectGet a list of all (persistent) attribute names of the object- Specified by:
getIdentityAttributeNamesin classPersistentObject- Returns:
- A list of all (persistent) attribute names of the object
-
-