Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd probably go with creating custom data structures to model your scenario. For example.</p> <p>Set class with a weight property and a reps property.</p> <p>Exercise class with a name property and a collection of Sets.</p> <p>Workout class with a collection of Exercises and a date property for when the workout was done.</p> <p>That way, if you wanted to extend it to include food you eat that day, you could either add it to the workout, or probably a better option would be to compose another class of a Workout and food eaten. </p> <p>That way you open the possibility to draw correlations between how well you trained on a certain day with what you eat.</p> <p>-- I'm a C# developer and I haven't touched Java before so apologies if the Syntax or the types aren't correct --</p> <pre><code>public class Set { public Set() { this._weight = 0; this._reps = new ArrayList&lt;int&gt;(); } private BigDecimal _weight; private List&lt;int&gt; _reps; // implement public properties / methods } public class Exercise { public Exercise() { this._name = ""; this._sets = new ArrayList&lt;Set&gt;(); } private String _name; private List&lt;Set&gt; _sets; // implement public properties / methods } public class Workout { public Workout(Date workoutDate) { this._date = workoutDate; this._exercises = new ArrayList&lt;Exercise&gt; } private Date _date; private List&lt;Exercise&gt; _exercises; // implement public properties / methods } </code></pre> <p>Then you'd be able to store a List and order them by Date using a custom implementation of <code>Comparator&lt;Workout&gt;</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload