Class FitnessDatabase

java.lang.Object
yearreview.app.data.sources.fitness.databse.FitnessDatabase
All Implemented Interfaces:
Iterable<Activity>

public class FitnessDatabase extends Object implements Iterable<Activity>
A Database that stores Activities sorted by their starting times. The Database also allows for iteration of Activities by their starting time.
Author:
ColdStone37
  • Field Details

  • Constructor Details

    • FitnessDatabase

      public FitnessDatabase()
      Default Constructor for a FitnessDatabase that initializes the Set used for storing the Activities.
  • Method Details

    • insertActivity

      public void insertActivity(Activity a)
      Inserts an Activity into the Database.
      Parameters:
      a - Activity to insert
    • iterator

      public Iterator<Activity> iterator()
      Returns an iterator for the Database that provides the Activities sorted by their starting time. Needed to implement the Iterable-interface.
      Specified by:
      iterator in interface Iterable<Activity>
      Returns:
      Iterator for the Activities stored in the Database